Seiai Posted May 9, 2015 Share Posted May 9, 2015 (edited) i am trying to use an RPC, but i need to also pass a target along with the procedure call. in the example from http://forums.kleientertainment.com/topic/47353-guide-getting-started-with-modding-dst-and-some-general-tips-for-ds-as-well/#EngineDifferences the remote procedure just gets the player as parameter, without having it passed along. there seem to be an dataparameter in HandleModRPC, but i didnt manage to get anything working. is there a way to pass additional data along an RPC? Edited May 9, 2015 by Seiai Link to comment https://forums.kleientertainment.com/forums/topic/53711-parameters-for-rpc/ Share on other sites More sharing options...
DarkXero Posted May 9, 2015 Share Posted May 9, 2015 AddModRPCHandler(modname, "withtarget", function(player, target) if target then print("Player = ", player.prefab, "Target = ", target.prefab) endend)AddPlayerPostInit(function(inst) inst:DoPeriodicTask(5, function() local dummy = GLOBAL.SpawnPrefab("glommer") SendModRPCToServer(MOD_RPC[modname]["withtarget"], dummy) end)end)Player always gets passed. Link to comment https://forums.kleientertainment.com/forums/topic/53711-parameters-for-rpc/#findComment-635855 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now