From JC2-MP Documentation
This is deprecated as of 0.2.
It has been replaced by NetworkObjectValueChange
|Arguments (in table)||Player player, string key, object value|
Fired when Player:SetNetworkValue is called from any module on the server. It is not fired by calling Player:SetValue.
Use '/set playername key value' to set players' values on both server and client.
function Foo(args) print(tostring(args.player).."'s "..args.key.." was set to "..tostring(args.value)) end Events:Subscribe("PlayerNetworkValueChange", Foo) function ConsoleSet(args) local words = args.text:split(" ") if #words == 3 then local player = Player.Match(words) if player then player:SetNetworkValue(words, words) else print("Player not found!") end else print("Invalid arguments!") end end Console:Subscribe("set", ConsoleSet)
Prints any value changes to the chat. Used in combination with the server script above.
function Foo(args) Chat:Print( tostring(args.player).."'s "..args.key.." was set to "..tostring(args.value), Color.Yellow ) end Events:Subscribe("PlayerNetworkValueChange", Foo)