Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Someone help fix this script to update money from a value to a text box?

I am coding a simulator and you earn cash when you do certain things in the simulator and instead of using the leader-board method of collecting cash I am doing it a different way in a Gui.

Before I switched the game from Experimental Mode to Filtering Enabled this script worked fine and would update the money but as of switching it to FE the script no longer works but through testing I know the value has the amount of money it should in it but the textlabel does not project this as it should.

while true do
	wait(.5)
	script.Parent.Parent.moneydisplay.Text = "$"..script.Parent.Value
end

That is all the code and I just cant get my head round why it doesnt work.

2 answers

✓ Accepted answer

###You shouldn't use while loops for those kinds of things. Use an event instead.

script.Parent.Changed:Connect(function(value)
    script.Parent.Parent.moneydisplay.Text = "$" .. value
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.