Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a Animation Trigger?

How can I.. Activate a animation once a player touches a part? I also want to know how to time an Animation.

EDIT: The Animation is to be played on the one who touches the part.

2 answers

function onTouched()

local playerCharacter = game.Players.LocalPlayer.Character.Humanoid

local playerAnimation = Instance.new("Animation")

playerAnimation = "http://www.roblox.com/asset/?id=144427269"

local loadAnimation = playerCharacter:LoadAnimation(playerAnimation)

loadAnimation:Play()

end script.Parent.Touched:connect(onTouched)

I put it inside a script, then into a block. However, when I touch the brick, no animation is played. Why is this?

Only thing I would be able to think of is end should be separated.

end 
script.Parent.Touched:connect(onTouched)

This discussion is preserved as it was. New answers, comments, and votes are closed.