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

Stage +1 Script not working?

Asked by 8 years ago

So, i'm making a character customization script and I have a good grasp on lua, but I don't see where I messed up, and I don't understand the console output.

local Stage = script.Parent.Parent
script.Parent.MouseButton1Click:connect(function()
    Stage.Value = Stage+1
end)

19:24:23.023 - Auto-Saving... 19:24:26.946 - Players.Player1.PlayerGui.ScreenGui.Frame.ScrollingFrame.TextButton.LocalScript:3: attempt to perform arithmetic on upvalue 'Stage' (a userdata value) 19:24:26.946 - Stack Begin 19:24:26.947 - Script 'Players.Player1.PlayerGui.ScreenGui.Frame.ScrollingFrame.TextButton.LocalScript', Line 3 19:24:26.947 - Stack End 19:28:02.312 - Auto-Saving...

2 answers

Log in to vote
1
Answered by 8 years ago

Change line 3 to the following:

Stage.Value = Stage.Value + 1
Ad
Log in to vote
1
Answered by
Csharp0 10
8 years ago

Assuming Stage is an IntValue or NumberValue, then you will need to use Stage.Value like NoaWillCode stated above.

Also try this in Line2:

script.Parent.MouseButton1Up:connect(function()

That will make the script fire when you release your mouse over the button (I assume it's a button).

Answer this question