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

If the animation ID is the problem, how to I get the real one?

Asked by
neoG457 315 Moderation Voter
9 years ago
local enabled = true
Player = script.Parent.Parent
--Player:WaitForDataReady()
mouse = Player:GetMouse()
run = game:GetService("RunService")
function onKeyDown(key)
if not enabled then return end
enabled = false
    key = key:lower()
    if key == "z" then

local animation = Instance.new("Animation")
        animation.AnimationId = "b126ab943d35e9b7e3bb92379d9504d7"

    local animTrack = humanoid:LoadAnimation(animation)
            animTrack:Play()

    end     
end

enabled = true


mouse.KeyDown:connect(onKeyDown)

Im not sure if the animation is stopping it from working or if it is the OnKeyDown, please help.

0
Is the script local? EzraNehemiah_TF2 3552 — 9y
0
No. neoG457 315 — 9y
0
Is it meant to be? neoG457 315 — 9y
0
Not exactly, but's it's recommended. It's easier to find the player in a local script using LocalPlayer. EzraNehemiah_TF2 3552 — 9y
View all comments (2 more)
0
Also, to get the animation, press export in the animation editor. It will cost you some robux though. EzraNehemiah_TF2 3552 — 9y
0
How would I get the asset ID? neoG457 315 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

To get your asset Id you need to Export the animation. Do this by going to the animation editor > (Make your animation) Click the + in th upper left hand corner > Click export. When it is finished uploading go to your inventory > Animations > (your animation) Now copy the numbers at the end of the link.

Put the numbers in the script like so:

local enabled = true
Player = script.Parent.Parent
--Player:WaitForDataReady()
mouse = Player:GetMouse()
run = game:GetService("RunService")
function onKeyDown(key)
if not enabled then return end
enabled = false
    key = key:lower()
    if key == "z" then

local animation = Instance.new("Animation")
        animation.AnimationId = "http://www.roblox.com/asset/?id=218192180" --218192180 is an example. Replace it with your ID

    local animTrack = humanoid:LoadAnimation(animation)
            animTrack:Play()

    end     
end

enabled = true


mouse.KeyDown:connect(onKeyDown)

Ad

Answer this question