local player = game.Players:GetPlayerFromCharacter(part.Parent)
local stat = "Cash"
local num = 0
local amount = 20
local amount2 = 50
local amount3 = 175
while true do -- Constantly Changing Number to Help randomize
wait(1)
num = num +1
if num >= 10 then
num = 0
end
end
function onTouched(hit)
if num <= 5 and player then -- If nubmer is any number bellow or equal to 0 they get 25 cash
player.leaderstats[stat].Value = player.leaderstats[stat].Value + amount
end
if num == 6 or 7 or 8 or 9 and player then -- If number is 6-9 they get 50 cash
player.leaderstats[stat].Value = player.leaderstats[stat].Value + amount2
end
if num == 10 and player then -- If number is 10 they get 175 cash!
player.leaderstats[stat].Value = player.leaderstats[stat].Value + amount3
end
end
script.Parent.Touched:connect(onTouched)
I see know error in the output box
I dont understand the problem D:

1 comment
num = 1, and you check if num = 5 or higher. Also add ends for ifs