Hey, I made a script that exchanges currency from strength to rebirth and instead of taking 500 strength, it takes all the collected strenght please a help
game.ReplicatedStorage.Rebirth.OnServerEvent:connect(function(player) if player.leaderstats.strength.Value >= 500 then -- strength needed to rebirth player.leaderstats.rebirths.Value = player.leaderstats.rebirths.Value +1 player.leaderstats.strength.Value = 0 end end)
game.ReplicatedStorage.Rebirth.OnServerEvent:connect(function(player) if player.leaderstats.strength.Value >= 500 then -- strength needed to rebirth player.leaderstats.rebirths.Value = player.leaderstats.rebirths.Value +1 player.leaderstats.strength.Value = player.leaderstats.strength.Value - 500 end end)
You were setting it to zero instead of subtracting from the current value, here is a fixed version