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

How do I make animations play in game? [closed]

Asked by
drcelt -3
4 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.

So I watched the TheDevKing's video on how to play animations and I can't seem to get it working.

(Quick note that I am following the script that TheDevKing exactly, time that the script is finished here: https://youtu.be/tnvlWtuCqUw?t=1143)

0
What do you mean specifically? ZIRFAL3 17 — 4y
0
Do you want to change the walk animation, idle, etc. or you want a character to play an animation? (for example you click a UI and your character plays an animation) ZIRFAL3 17 — 4y
0
Guess ill answer both.. ZIRFAL3 17 — 4y
0
To change character animations: Press play to start (or F5), go to the Workspace and search for your character, inside of him you will see a local script called Animate, copy it, and press stop (or shift + F5) and paste the script in StarterPlayer --> StarterCharacterScripts. To edit the animations you just go inside the script and you will se some values,inside of them there's the animations, ZIRFAL3 17 — 4y
0
or enter the script and modify those ids, in the script you can change the emotes. ZIRFAL3 17 — 4y

Closed as off-topic by JesseSong

This question has been closed by our community as being off-topic from ROBLOX Lua Scripting.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
ZIRFAL3 17
4 years ago

To make a character play an animation:

This only works in local scripts (i think, im kind of new).

Inside a TextButton, inside a GUI in starterGUI:

local Anim = Instance.new("Animation") -- create the animation.
Anim.AnimationId = "http://www.roblox.com/asset/?id=5517298285" -- Set the Animation's id.
Anim.Parent = script -- Parent the animation to the script.
local Character = game.Players.LocalPlayer.Character -- Get Character.
local AnimLoaded = Character:WaitForChild("Humanoid"):LoadAnimation(Anim) -- Load Animation,we are going to need this for the character to play the anim.

script.Parent.Activated:connect(function() -- Player clicked the UI/GUI.
    AnimLoaded:Play() -- Play the animation.
    wait(3)
    AnimLoaded:Stop() -- Stop Anim.
end)

That should work. BTW dont use that animation, i made it and its really bad.

Ad