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

How would you add a wait to this script so the animations aren't synced?

Asked by 5 years ago

I have this script that plays an idle animation in an NPC (and there's an animation inside of it in Workspace) but the animations are all synced and it looks weird (ex. when the animation lifts a hand every NPC with that animation does so at the exact same time).

I tried to add a "wait(#)" with different numbers for each NPC before the "idle:Play()" but they are still synced up. Is there a way to add a wait to it at all, or would I have to make a new script?

local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local idle = humanoid:LoadAnimation(animation)
idle:Play()
0
wait() should be after line 3 DeceptiveCaster 3761 — 5y
0
line 4, excuse me DeceptiveCaster 3761 — 5y
0
I'll try that and give you feedback. SheriffTaco 13 — 5y
0
It didn't work, sorry SheriffTaco 13 — 5y
View all comments (4 more)
0
Well did you add a wait or just use wait()? Try wait(1), otherwise it’s its like a .03 second wait and likely not noticeable by your eyes DinozCreates 1070 — 5y
0
Yes, I typed different numbers for each NPC. I wonder if it has anything to do with me testing it in Studio. SheriffTaco 13 — 5y
0
I think it might be that the animations are loading after everything else loads, so (with my crappy computer) I would need to extend the waits to like 30 seconds or somehow make the script run after everything else has loaded in. SheriffTaco 13 — 5y
0
i bet your computer has like a 5400 rpm mechanical drive or something if it's doing that DeceptiveCaster 3761 — 5y

Answer this question