I am doing a LocalScript to Script RemoteEvent and everything works PERFECTO!! Absolutely no problems, works as intended.
BUT!
Of course, there is a problem that Roblox served me.
When I set leaderstat value (for example Cash value) to a number above 0 (for example 123
) it works well.
When I try to set it as 0
or nil
it doesn't work. It doesn't work anyway. I copied the script from the working one and the ONLY thing I changed was to change 123
to 0
.
IT DOESN'T WORK when it's set to 0, works if set to any number other than 0.
WHAT CAN BE THE CASE? Here is the code, you asked for it:
LocalScript
:
game.ReplicatedStorage.SETCASH:FireServer()
Script
:
game.ReplicatedStorage.SETCASH.OnServerEvent:Connect(function(plr) plr.leaderstats.Cash.Value = 0 end)
and, to the point it's plr.leaderstats.Cash.Value = 1 or more
it works nice. Except for 0 (like in code)
Also, I made sure to include all necessary RemoteEvents in RemoteStorage.
Also, I tried doing this some time ago and it was the same result, still isn't fixing, so it shouldn't be a temporary bug.