Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

when the server event activates it changes the value to -1, instead of subtracting 1?

Asked by 4 years ago

when this server event is activated, one value goes up by 1, while the other (is supposed to be subtracted by 1) but goes to -1

local event = game.ReplicatedStorage:WaitForChild("Events").Strength

event.OnServerEvent:Connect(function(player)
    local spoints = player:WaitForChild("GameValues").strength
    spoints.Value = spoints.Value + 1
    local points = player:WaitForChild("GameValues").points
    points.Value = points.Value - 1
end)

Answer this question