So i'm trying to make it so you cant exceed a certain amount of coins. This is what i got so far:
game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new("Folder",plr)
stats.Name = "leaderstats"
local coins = Instance.new("IntValue",plr.leaderstats)
coins.Name = "Coins"
coins.Value = 0
plr.leaderstats.Coins.Changed:Connect(function()
local max = 10
if Coins.Value > max then
Coins.Value = 10
end
end)
end)

3 comments
ty
Is there even a need for the else part?
yah thats probarly uneeded @Exo_Byte