You put it into a perpetual while loop then told it after the while loop ends, do something. So it was never able to do what you asked. If we change the value before the while loop though, it wont do what im thinking you want it to.
local MushNorm = script.Parent.Value.Value
wait(10)
script.Parent.Value.Value = 3
while true do
if MushNorm < 2 then
script.Parent.Texture = "rbxassetid://2812600930"
wait(3)
script.Parent.Texture = "rbxassetid://2812602676"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812603913"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812605479"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812606670"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812605479"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812603913"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812602676"
wait(0.05)
else
script.Parent.Texture = "rbxassetid://2813243667"
end
end
A different way to do it. 10 seconds is roughly 3 times your while loop, so we could just run it 3 times then change our value and texture ID.
local MushNorm = script.Parent.Value
for i = 1, 3, 1 do
script.Parent.Texture = "rbxassetid://2812600930"
wait(3)
script.Parent.Texture = "rbxassetid://2812602676"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812603913"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812605479"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812606670"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812605479"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812603913"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812602676"
wait(0.05)
end
MushNorm.Value = 3
script.Parent.Texture = "rbxassetid://2813243667"
This method should also work for you, im making it under the assumption that MushNorm is starting off at 0. So it will run 3 times, incrementing the value by once, then once it gets to 3 it would start running else instead.
local MushNorm = script.Parent.Value
while true do
if MushNorm < 3 then
script.Parent.Texture = "rbxassetid://2812600930"
wait(3)
script.Parent.Texture = "rbxassetid://2812602676"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812603913"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812605479"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812606670"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812605479"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812603913"
wait(0.05)
script.Parent.Texture = "rbxassetid://2812602676"
wait(0.05)
MushNorm.Value = MushNorm.Value + 1
else
script.Parent.Texture = "rbxassetid://2813243667"
end
end
2 comments
I'm insanely new to scripting and I understand the spawn some but don't know how to properly use it. Also what do you mean about the last sentence?
spawn is very useful, but its not totally neccesary for what you're doing. i showed a couple other ways you could achieve what(i think) you're looking for.