I done a script (local script) that calls a remote event to change a player value Heres the script:

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.NewAdd:FireServer(3)
end)

And heres the script in server script service:

game.ReplicatedStorage.NewAdd.OnServerEvent:Connect(function(plr,AddV)
	plr.Add.Value = AddV
end)

EDIT: I Said that when i click then i dont get the new value of my current value. In other words it did NOT changed.

4 comments

0

I strongly recommend not doing this the way you are. If you do, that value can be exploited VERY easily.

0

But i did a anti exploit thing

0

game.ReplicatedStorage.NewClicks.OnServerEvent:Connect(function(plr,Add) if Add >= 51 then plr:Kick("GET DUNKED ON YOU DIRTY HACKER! (Thx for hacking cause i could say that :D)") end plr.leaderstats.Clicks.Value = plr.leaderstats.Clicks.Value +Add end)

0

Explain your problem a bit more. All you've shown is your script.