From JC2-MP Documentation
This is deprecated as of 0.2.
It has been replaced by SharedObjectValueChange
|Arguments (in table)||Player player, string key, object value|
Fired when a player's value changes. Player values are persistent across modules, but not between server/client.
The event is fired when Player:SetValue is called from any module. It is not fired by calling Player:SetNetworkValue.
Use '/set key value' and '/get key' to play around with it.
function Foo(args) Chat:Print( tostring(args.player).."'s "..args.key.." was set to "..tostring(args.value), Color.Yellow ) end Events:Subscribe("PlayerValueChange", Foo) function LocalPlayerChat(args) local words = args.text:split(" ") if words == "/set" and #words == 3 then LocalPlayer:SetValue(words, words) elseif words == "/get" and #words == 2 then local value = LocalPlayer:GetValue(words) Chat:Print( words.." is currently set to "..tostring(value), Color.Yellow ) end end Events:Subscribe("LocalPlayerChat", LocalPlayerChat)
- If you set a key to the value it's already set to, the event will still fire.