Hey!
Thanks for taking your time out of your day to help me.
As the title states, I got an issue limiting the amount of money a player can hold.
So what I'm trying to do is make the player only hold 100 money at once, and when the player tries to get more, his money gets limited back to 100 . This also is whenever the player loses money, he cannot go less than 0 .
This script does not limit anything though! The player's money goes less than 0 and more than 100 !
Any help would be surely appreciated.
I'm new to coding, so all this is new to me.
Code:
wait (20)
game.Players.PlayerAdded:Connect(function(player)
if player.leaderstats2.Money.Value <= 0 then
player.leaderstats2.Money.Value = 0
end
if player.leaderstats2.Money2.Value <= 0 then
player.leaderstats2.Money2.Value = 0
end
if player.leaderstats2.Money.Value <= 100 then
player.leaderstats2.Money.Value = 100
end
if player.leaderstats2.Money2.Value <= 100 then
player.leaderstats2.Money2.Value = 100
end
end)

2 comments
Did you comment on my answer?
Yeah, I still can't get it to work. Still goes below.