Ive got it to work when being touched, but it only works once, any suggestions?
local db = true local animation = script:WaitForChild('Animation') local humanoid = script.Parent:WaitForChild('Humanoid') local anim = humanoid:LoadAnimation(animation) script.Parent.Crate.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then if db == true then db = false anim:Play() end end end)
Your settings db to false and never setting it to true again thats the reason.
Also, instead of doing this
if db == true then --do something end
Do this
if db then --do something end