#Need help with this working.

1 messages · Page 1 of 1 (latest)

rotund pecan
#
local head = nail:WaitForChild("Head")
local knock =head:WaitForChild("knock")
local please = head:WaitForChild("pleaseopen")

repeat
    knock:Play()
    local anim = script.Animation
    local hum = script.Parent:WaitForChild("Humanoid")
    local animator = hum:WaitForChild("Animator")

    local track = animator:LoadAnimation(anim)
    track.Looped = true

    track:Play()
    task.wait(2)
    
return    
    
    please:Play()
    local anim = script.Animation
    local hum = script.Parent:WaitForChild("Humanoid")
    local animator = hum:WaitForChild("Animator")

    local track = animator:LoadAnimation(anim)
    track.Looped = true

    track:Play()
    task.wait(3)
until false```
#

If you need more info then just ask!

zealous forge
#

Could you provide errors or describe the issues?

rotund pecan
#

I need this script to play a sound and animation at the same time. after the sound and animation finished another sound and animation plays again at the same time. and this loops until the player interacts with them that Ill make later

zealous forge
#

And it isn't working now? I am asking how it isn't working?

rotund pecan
#

havent tested it yet but studio says that there are errors

#

and I know nothing about scripting

zealous forge
#

In order for me to diagnose the script, I would need to see your output.

rotund pecan
#

Idk if this helps

fleet trench
#

Remove return

rotund pecan
#

alr

#

wait

#

i think I got smth

#

But I made a video explaining what he would do

#

And well here is the script that doesnt work

fleet trench
#

I think you should really learn how to code. track:Play and track:Stop together. You are referring to anim, hum, animator, track twice.

rotund pecan
#

then I must've switched them up

#

ill have to make placholder anims

#

like its supposed to play the sound and anim

#

then it ends

#

after that another plays and ends then repeats

fleet trench
#

Use .Completed:Wait if you wanna make it play new one after old one finished