Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --How-to for SP-friendly server-sided RPCs
- --The function which contains actual code
- local MyFunctionToExecuteOnAllMachines = function(arg1,arg2)
- --code
- end
- if not worldInfo:IsSinglePlayer() then
- worldGlobals.CreateRPC("server","reliable","MyFunctionHost",function(arg1,arg2)
- MyFunctionToExecuteOnAllMachines(arg1,arg2)
- end)
- else
- worldGlobals.MyFunctionHost = MyFunctionToExecuteOnAllMachines
- end
- --And then you can just call "worldGlobals.MyFunctionHost" when needed and don't care for SP/MP checks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement