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

How can I change a TextBox's text when a player gets enough points?

Asked by 10 years ago

This script is located in "StarterGui" Here is what I tried:

01local fgui = script.Parent:WaitForChild("rockettips")
02local tgui = fgui:WaitForChild("TextBox")
03 
04local stats = script.Parent.Parent:WaitForChild("leaderstats")
05local point = stats:WaitForChild("Points")
06local points = point.Value
07 
08repeat
09    wait(0.1)
10until points > 9
11tgui.Text = "Wall Rocket Earned!"
12wait(3)
13tgui.Text = "Next Rocket at 20 points"
14repeat
15    wait(0.1)
View all 31 lines...

1 answer

Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
10 years ago
01local fgui = script.Parent:WaitForChild("rockettips")
02local tgui = fgui:WaitForChild("TextBox")
03 
04local stats = script.Parent.Parent:WaitForChild("leaderstats")
05local point = stats:WaitForChild("Points")
06 
07local rocket = 0
08 
09point.Changed:connect(fucntion(rocket)
10if point.Value > 9 and rocket == 0 then
11rocket = 1
12tgui.Text = "Wall Rocket Earned!"
13wait(3)
14tgui.Text = "Next Rocket at 20 points"
15 
View all 35 lines...

What I did was change it so every time the leaderstat 'Points' get changed it checks to see if it is the correct value. I also set up a test to see if they have already claimed it (Hence the local rocket).

If this doesn't work please tell me and I will try to fix whatever is broken.

0
Thanks! After fixing the errors, your script worked. spyclub65 20 — 10y
0
Lol, i keep noticing things that i did wrong :/ and np for helping you fix it :D lomo0987 250 — 10y
Ad

Answer this question