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

Text on GUI goes after reset?

Ive got code which shows your money on a gui. It changes the gui when you get money but when i reset it everything in the box disappears. Help please

script.Parent.Parent.Parent.Parent.Parent.leaderstats.Level.Changed:connect(function(level)
	wait(0.2)
	script.Parent.Text = level
end)

1 comment

0

the leaderstats are normally where they are and the script is a normal script inside the textlabel

2 answers

✓ Accepted answer

If you make a the script a 'Local script' you can make your code simple.

while wait() do
	script.Parent.Text = "Level "..game.Players.LocalPlayer.leaderstats.Level.Value
end

3 comments

0

Thanks, wouldn't this cause lag though? Im paranoid about lag

0

I believe there should be a wait in there to avoid it from executing like every milisecond and lagging the f**k out of your game.

1

line 1 idiot

Rather than recording the money value when it changes, I'd recommend using an infinite loop so that it checks every second or so. Here is a script for that:

while true do
level = script.Parent.Parent.Parent.Parent.Parent.leaderstats.Level.Value
script.Parent.Text = level
wait(1)
end

2 comments

0

mine is better

0

alright jesus christ no need to rub it in

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