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

Bill.Value = SurfaceGui.Text Help?

Asked by 9 years ago

Off of a few threads. I've come to this. I still need help though.

Basically when you select the tool and click on this brick with the code in it (below) it changes the Value of a NumberValue called "Bill" inside the brick. When the value is changed the SurfaceGui Text changes to the Value. But the problem is, it's not working. Help?

Output - 21:42:49.790 - Equipped is not a valid member of Part 21:42:49.792 - Script 'Workspace.Sign10.Main.Script', Line 4

Current Script: local bill = script.Parent.Bill local surfacegui = script.Parent.SurfaceGui.TextLabel

script.Parent.Equipped:connect(function(m) surfacegui.Text = ("$"..tostring(bill.Value)) end)

1 answer

Log in to vote
0
Answered by 9 years ago

Whatever you're trying to equip cannot be equipped. You're referencing the part instead of the tool itself. The part must be inside a "Tool". And the script itself should just be another child of the Tool. Here's the script assigned to equip the tool itself in those conditions:

local bill = script.Parent.Bill local surfacegui = script.Parent.SurfaceGui.TextLabel

script.Parent.Equipped:connect(function(m) surfacegui.Text = ("$" .. bill.Value)

end)

0
FYI: That will change the value upon equip, not when you click something. Atleast this piece of code alone would. Sectarian 5 — 9y
Ad

Answer this question