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

there is an Error on a line for money change gui?

Asked by 8 years ago

Ok so this is for my admin panel for changing peoples money but it seems to error on a line so I will put a comment on what line!

01script.Parent.AdminPanel["Add/Subtract Money"].Submit.MouseButton1Down:connect(function()
02    if (script.Parent.Parent.Parent.userId == 10271988 or 22701216 or 85629297 or game.CreatorId) then
03        local aplayer = script.Parent.AdminPanel["Add/Subtract Money"].Username.Text
04        local player = game.Players:WaitForChild(aplayer)
05        local amount = tonumber(script.Parent.AdminPanel["Add/Subtract Money"].Amount.Text)
06        if script.Parent.AdminPanel["Add/Subtract Money"].Type.Text == "Add" then
07        --this line below has an error
08        player.Money.Value = game.Players[player].Money.Value + amount
09        end
10        if script.Parent.AdminPanel["Add/Subtract Money"].Type.Text == "Subtract" then
11            player.Money.Value = game.Players[player].Money.Value - amount
12        end
13        if script.Parent.AdminPanel["Add/Subtract Money"].Type.Text == "Change" then
14            player.Money.Value = amount
15        end
View all 36 lines...
0
what does the error sa? jacobwow 140 — 8y
0
Please edit the question and put in what your error is. We cannot help you as easily/quickly if we don't have the error lightpower26 399 — 8y

1 answer

Log in to vote
1
Answered by
Robin5D 186
8 years ago
Edited 8 years ago

Why are you using "game.Players[player].Money.Value + amount" instead of just player.Money.Value + amount? Makes it way simpler. I made a simple script with my own gui with this and fixed it by doing this.

Ad

Answer this question