#Door knocking animation

1 messages · Page 1 of 1 (latest)

abstract atlas
#
local head = nail:WaitForChild("Head")
local knock =head:WaitForChild("knock")
local please = head:WaitForChild("pleaseopen")

repeat
    knock:Play()
    --this is where the animation would play out
    task.wait(2)
    please:Play()
    task.wait(3)
until false```
#

this is the script that I have

weary berry
#

isnt repeat until false the same as while true do

abstract atlas
#

Idk I asked a developer of a game for the code cuz I loved the idea of the game

#

so basically a cameo in my game

#

this is what they gave me so yeah

worthy jolt
#

so you want to play this animation when the sound is playing?

abstract atlas
#

yes

#

when the sound starts the animation starts at the same time

worthy jolt
#

alright

#

so

#

just do it in .Played Event

#

in sound

#

it fires every time they sound is played

#

(which just means that the function sound:Play() is fired)

#

i would write you the code but i forgot how to add this code label in discord

abstract atlas
#

its just

#

bruh

#

.``.`

#

its three `

worthy jolt
#

😭

#

ah okay

abstract atlas
#

three ` things

worthy jolt
#

''' like that? '''

abstract atlas
#

ye

#

no

#

ctrl + 7

worthy jolt
#

oh this one

abstract atlas
#

ye

worthy jolt
#

yes

#

alr

#
--you can write something like:
local sound = your_sound
sound.Played:Connect(function()
  animation:Play()

) 
#

it should work

abstract atlas
#

is it possible with animation id or something?

worthy jolt
#

yeah

#

but cant you just then create an animation instance?

#

with the id

abstract atlas
#
local head = nail:WaitForChild("Head")
local knock =head:WaitForChild("knock")
local please = head:WaitForChild("pleaseopen")

repeat
    knock:Play()
    sound.Played:Connect(function()
                animation:Play()
    task.wait(2)
    please:Play()
    task.wait(3)
until false```
#

Something like this maybe?

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

repeat
    knock:Play()
    knock.Played:Connect(function()
                animation:Play()
    task.wait(2)
    please:Play()
    task.wait(3)
until false```
#

or this?

worthy jolt
#

whats knock and please?

abstract atlas
#

Knock is well knocking

worthy jolt
#

yeah but i mean is it animation, sound

abstract atlas
#

and please is just someone saying "please open the door"

abstract atlas
worthy jolt
#

are these sounds or animations

#

or something diffrent

#

like a part

#

or idk

abstract atlas
#

I was watching a vid

worthy jolt
#
local nail = script.Parent
local head = nail:WaitForChild("Head")
local knock =head:WaitForChild("knock")
local please = head:WaitForChild("pleaseopen")


knock.Played:Connect(function() -- this is an event and this code below will fire every time this knock sound is played
  please:Play()
  -- add more stuff here that will happen when the knock sound starts to play
end)
#

something like that

abstract atlas
#

alr ill try