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

How do I make a Animation Trigger?

Asked by 10 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

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

Log in to vote
0
Answered by 10 years ago

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?

Ad
Log in to vote
0
Answered by 10 years ago

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

end 
script.Parent.Touched:connect(onTouched)

Answer this question