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

Need help with this custom animation code?

Asked by 9 years ago

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

Log in to vote
0
Answered by
davness 376 Moderation Voter
9 years ago

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

0
Thanks but im still getting an error code on "if" -- Expected ')' (to close '(' at line 2), got 'if' idesoiate 0 — 9y
Ad
Log in to vote
0
Answered by
xPolarium 1388 Moderation Voter
9 years ago

Line 2, "function" is misspelled incorrectly.

Plr.Chatted:connect(functiom(msg)

That should fix the "if" error

Answer this question