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

Need help with this custom animation code?

When the player types "/e dance3' I was expecting it to play one of my custom animations.

Heres the code

game.Players.PlayerAdded:connect(function(Plr)
Plr.Chatted:connect(functiom(msg)
if msg == "/e dance3" then
A = Instance.new("Animation", Plr.Character)
A.AnimationId = "www.roblox.com/Asset?ID=myidwillgohere" 
track = Plr.Character.Humanoid:LoadAnimation(A)
track:Play()
end
end)
end)

Getting error from "if"

Also how do I get the asset ID from a custom animation? Do I just use the one available on my profile? I cant find the asset URL anywhere.

Thanks.

2 answers

You, on the ROBLOX site, have an URL like this:

http://www.roblox.com/Begging-to-god-item?id=216740791 - it's just an example

Then, collect the ID: on this case, is 216740791

Then, subtract one to it: 216740791 - 1 = 216740790

Then, put it on this string value:

Something.Texture = "rbxassetid://216740790"

Hope I helped!!! More info here

1 comment

0

Thanks but im still getting an error code on "if" -- Expected ')' (to close '(' at line 2), got 'if'

Line 2, "function" is misspelled incorrectly.

Plr.Chatted:connect(functiom(msg)

That should fix the "if" error

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