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

01game.Players.PlayerAdded:connect(function(Plr)
02Plr.Chatted:connect(functiom(msg)
03if msg == "/e dance3" then
04A = Instance.new("Animation", Plr.Character)
05A.AnimationId = "www.roblox.com/Asset?ID=myidwillgohere"
06track = Plr.Character.Humanoid:LoadAnimation(A)
07track:Play()
08end
09end)
10end)

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:

1Something.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.

1Plr.Chatted:connect(functiom(msg)

That should fix the "if" error

Answer this question