trying to make coins stack up to an amount so i dont get infinite amount of coins
scritpt:
f = 1
while f<3 do
local coin = game.ServerStorage.baseCoin:Clone()
coin.Parent = game.workspace
coin.Name = "Coin"
print(f)
coin.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value +1
game.Workspace:WaitForChild("Coin"):Destroy()
f = f - 1
end
end)
wait(5)
f = f + 1
end
** You are now Level 9! **