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

what could I do so the while loop actually loops through the text and not cause an error?

Asked by
oSyM8V3N 429 Moderation Voter
6 years ago
001wait(game.Lighting.TimeToLoad.Value)
002 
003local UIS = game:GetService("UserInputService")
004local p = game.Players.LocalPlayer
005chainnum = 0
006chain = "None"
007chainText = "None"
008 
009 
010--//Animations
011local combat1 = script:FindFirstChild("Animations").punchOne
012local animTrack1 = p.Character.Humanoid:LoadAnimation(combat1)
013--
014local combat2 = script:FindFirstChild("Animations").punchTwo
015local animTrack2 = p.Character.Humanoid:LoadAnimation(combat2)
View all 118 lines...

The while wait(1) do part is where the problem occurs. Any help?

0
Change the while loop to this: GiveMeYourPudding 64 — 6y
0
while true do GiveMeYourPudding 64 — 6y
0
if p.PlayerGui.PlayerGuis.Menu.mouseLabels.TextLabel.Text == oldtext and chainnum > 0 then 111 p.PlayerGui.PlayerGuis.Menu.mouseLabels.TextLabel.Text = 'None' --this would technically be none since it's empty 112 chainnum = 0 113 else 114 oldtext = p.PlayerGui.PlayerGuis.Menu.mouseLabels.TextLabel.Text 115 end wait(1) end GiveMeYourPudding 64 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

Change your while loop to this:

1while true do
2    if p.PlayerGui.PlayerGuis.Menu.mouseLabels.TextLabel.Text == oldtext and chainnum > 0 then
3        p.PlayerGui.PlayerGuis.Menu.mouseLabels.TextLabel.Text = 'None' --this would technically be none since it's empty
4        chainnum = 0
5    else
6        oldtext = p.PlayerGui.PlayerGuis.Menu.mouseLabels.TextLabel.Text
7    end
8    wait(1)
9end
0
I tried this, but when I change it to that, and whenever I click the mouse button, nothing happens this time oSyM8V3N 429 — 6y
0
Ohhh, it does work. I just had it in the wrong place. Thanks Firplius for the help, I was stuck on this for a long while :) oSyM8V3N 429 — 6y
Ad

Answer this question