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

(SOLVED) How do i make this 2D animation on a BillboardGUI stop?

Asked by 4 years ago
Edited 4 years ago

In my game there is a skin that is 2D, there is a script inside of a billboardGUI that is used to make it have a walk animation, what ends up happening is that the animation doesn't stop.

Here is the code i wrote:

01script.Parent.Parent.Parent.Humanoid.Running:Connect(function(speed)
02    if speed > 0 then
03        repeat
04        script.Parent.ImageLabel.Image = "http://www.roblox.com/asset/?id=5515572147"
05        wait(0.2)
06        script.Parent.ImageLabel.Image = "http://www.roblox.com/asset/?id=5515572767"
07        wait(0.2)
08    until speed < 1
09    else
10        script.Parent.ImageLabel.Image = "http://www.roblox.com/asset/?id=5515571488"
11    end
12end)

FIXED CODE:

01local running = false
02 
03script.Parent.Parent.Parent.Humanoid.Running:Connect(function(speed)
04    if speed > 0 then
05        running = true
06    else
07        running = false
08    end
09end)
10 
11while true do
12    if running == true then
13        script.Parent.ImageLabel.Image = "http://www.roblox.com/asset/?id=5515572147"
14        wait(0.2)
15        script.Parent.ImageLabel.Image = "http://www.roblox.com/asset/?id=5515572767"
View all 21 lines...
0
i forgot to mention that the builboardGUI is put inside of the player's HumanoidRootPart. TheEnderG 7 — 4y

Answer this question