If you call a remote inteface from a script, arguments are wrong :
Code: Select all
require("defines")
function print_all(message)
for _, player in pairs(game.players) do
player.print(message)
end
end
local event = script.generate_event_name()
remote.add_interface("test", {
function1 = function(a,b,c)
print_all(serpent.line({a,b,c}))
game.raise_event(event, {player=player, permission=permission})
end,
function2 = function(a,b,c)
print_all(serpent.line({a,b,c}))
end
})
script.on_event(event, function(event)
remote.call("test", "function2", "a","b","c")
end)
script.on_event(defines.events.on_player_created, function(event)
remote.call("test", "function1", "a","b","c")
end)
Code: Select all
/c remote.call("test", "function1", "a","b","c")