snobW0lf
(BunnySnow)
March 18, 2022, 11:15pm
#1
I have a line of code to stop a looping animation, but not even the first print wont work,
coroutine.wrap(function()
print("hi")
for _, track in pairs (HUmanoid.Animator:GetPlayingAnimationTracks()) do
if track.Name == "Idle" then
track:Stop()
end
end
end)
```
1 Like
um maybe its the HUmanoid part.
snobW0lf
(BunnySnow)
March 18, 2022, 11:17pm
#3
Its supposed to be like that, I accidentally spelled it like HUmanoid when making the local varibale
Forummer
(Forummer)
March 19, 2022, 12:43am
#4
coroutine.wrap()
returns a function value wrapped around a coroutine, you need to call that function.
coroutine.wrap(function()
print("Hello world!")
end)()
local routine = coroutine.wrap(function()
print("Hello world!")
end)
routine()
1 Like
Forummer
(Forummer)
March 19, 2022, 1:14am
#6
That’s what I did in the first example I provided.
Here’s another.
local routine = coroutine.wrap(print)
routine("Hello world!")
maybe add a () at the end of the function so you actually call it
like this
coroutine.wrap(function)
print("noob")
end)()