I've seen Battle and RSNEO have functions stored in tables, so I tried putting my own functions in tables for something I've been working on, but when playing online, they won't archive. I tried looking in the wiki, then I tried using rawset to get to the actual weapon table like RSNEO, to looking at slingfunc itself, to eventually just using the RSNEO addweapon function to see if that would even work, but I haven't gotten it to work, is there a specific way I'm supposed to do it?
This should be working. And from the little tests I ran before replying the concept worked fine?
Lua:
local localTestTable = {
func1 = function(x) print(x) end,
func2 = function(x) print(x .. " 2") end
}
if not globalTestTable then rawset(_G, "globalTestTable", localTestTable) end
addHook("JumpSpinSpecial", function(player)
-- You can call the functions like globalTestTable['func1'](parameter) as well.
globalTestTable.func1(player.mo.skin)
globalTestTable.func2(player.mo.skin)
end)
If that's not what you meant could you try to fill me in a little more?
Post automatically merged:
I'm not familiar with RSNEO nor Battle, but could you be a little more specific? Because...
This should be working. And from the little tests I ran before replying the concept worked fine?
Lua:
local localTestTable = {
func1 = function(x) print(x) end,
func2 = function(x) print(x .. " 2") end
}
if not globalTestTable then rawset(_G, "globalTestTable", localTestTable) end
addHook("JumpSpinSpecial", function(player)
-- You can call the functions like globalTestTable['func1'](parameter) as well.
globalTestTable.func1(player.mo.skin)
globalTestTable.func2(player.mo.skin)
end)
If that's not what you meant could you try to fill me in a little more?
I'm not familiar with RSNEO nor Battle, but could you be a little more specific? Because...
This should be working. And from the little tests I ran before replying the concept worked fine?
Lua:
local localTestTable = {
func1 = function(x) print(x) end,
func2 = function(x) print(x .. " 2") end
}
if not globalTestTable then rawset(_G, "globalTestTable", localTestTable) end
addHook("JumpSpinSpecial", function(player)
-- You can call the functions like globalTestTable['func1'](parameter) as well.
globalTestTable.func1(player.mo.skin)
globalTestTable.func2(player.mo.skin)
end)
If that's not what you meant could you try to fill me in a little more?
Post automatically merged:
I'm not familiar with RSNEO nor Battle, but could you be a little more specific? Because...
This should be working. And from the little tests I ran before replying the concept worked fine?
Lua:
local localTestTable = {
func1 = function(x) print(x) end,
func2 = function(x) print(x .. " 2") end
}
if not globalTestTable then rawset(_G, "globalTestTable", localTestTable) end
addHook("JumpSpinSpecial", function(player)
-- You can call the functions like globalTestTable['func1'](parameter) as well.
globalTestTable.func1(player.mo.skin)
globalTestTable.func2(player.mo.skin)
end)
That was one of the ways I was trying to fix my problem, but it didn't work. I keep getting function archive errors because of the functions but when I load RSNEO, there's never been a single one.
Here's an example of what my table looked like before I was messing with it
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.