Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Whats wrong with this donate buttom?

Asked by 8 years ago

Why is this not working?

toBox=script.Parent.ToPlayer
amountBox=script.Parent.amount
plr=script.Parent.Parent.Parent.Parent
gtx = game.ServerStorage.MoneyStorage:FindFirstChild(player.Name)

script.Parent.Donate.MouseButton1Click:connect(function()
    toName=toBox.Text
    amount=tonumber(amountBox.Text)
    if game.Players:FindFirstChild(toName) then
        ToPlayer=game.Players[toName]
        if plr.gtx.Value>=amount and amount>0 and amount<1001 then
            plr.gtx.Value=plr.gtx.Value-amount
            ToPlayer.gtx.Value=ToPlayer.gtx.Value+amount
        end
    end 
end)

0
We need more information than a "why is this not working" and code snippet. What does the file tree look like? shayner32 478 — 8y

Answer this question