local animController = Instance.new("AnimationController")
local animTrack = animController:LoadAnimation(animation)
animTrack:Play()
With clicking the humanoid this would work
local animController = Instance.new("AnimationController")
local animTrack = animController:LoadAnimation(animation)
animTrack:Play()
With clicking the humanoid this would work
For a player:
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" -- your id here
local animTrack = Humanoid:LoadAnimation(animation) -- chanhe Humanoid to the target's Humanoid
animTrack:Play()
For something else:
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" -- your id here
local animController = Instance.new("AnimationController")
local animTrack = animController:LoadAnimation(animation)
animTrack:Play()
If you wanna launch it when a character's part is clicked, you could connect it via a Button1Down event
You could also (though the cursor looks ugly if you don't change it) use a ClickDetector
example:
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" -- your id here
local animController = Instance.new("AnimationController")
local animTrack = animController:LoadAnimation(animation)
game.Players.LocalPlayer:GetMouse().Button1Down:connect(function()
if game.Players.LocalPlayer:GetMouse().Target==thePartInTheModel then
animTrack:Play()
end
end)
^ how would I play that in game.
Put it in a script, and use animTrack:Play() when you wanna animate it
You would not want MouseButton1Down. That would not be a GUI.
Could you give me a mousebutton1down event script?
I meant Button1Down() (edited)
Where does the Animation and stuff belong to?
why other player can't see?
I tried this script and it just freezes studio :(
A script inside the Torso (with the Clickdetector already inside)
script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=144884906" -- your id here
local animTrack =script.Parent.Parent:FindFirstChild("Humanoid"):LoadAnimation(animation) -- change Humanoid to the target's Humanoid
animTrack:Play()
end)
Still doesn't seem to work I have the click detector am I doing somthing wrong?
What is the output?
Workspace.Dummy.Torso.Script:5: attempt to index a nil value 17:12:10.578 - Script 'Workspace.Dummy.Torso.Script', Line 5 17:12:10.578 - stack end 17:12:10.579 - Disconnected event because of exception 17:12:13.091 - doLoadAppearance http://www.roblox.com/Asset/?versionid=346499390&serverplaceid=0 time: 7.246339 17:12:13.215 - doLoadAppearance http://www.roblox.com/Asset/?versionid=317269006&serve
I fixed it nvm
It works when I do it test mode but not when I join it in game.
Start a new question and post your new script
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
What do you mean? Clicking the humanoid..? Please be more specific.
With a click detector placed in humanoid model if that makes sense.