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

Why does my script only work in test mode on studio and not on multiplayer servers? [UNSOLVED]

Asked by
Avectus 120
9 years ago

The code below is in a regular script, placed inside an NPC. The script works perfectly in test mode on studio but doesn't work in a multiplayer server, even if I'm the only person in the game.

The animation is one that I've made myself and is on my account.

wait(3)
Animation = Instance.new("Animation")
Animation.AnimationId = "http://www.roblox.com/Asset?ID=234539352" 
animTrack = script.Parent.Humanoid:LoadAnimation(Animation)

animTrack:Play()

Could anyone tell me what I need to do fix this?

Thanks.

0
Any errors? (Press F9 for Developer Console for output) chess123mate 5873 — 9y
0
http://prntscr.com/6pz2c2 Just these. Avectus 120 — 9y

2 answers

Log in to vote
2
Answered by
Wizzy011 245 Moderation Voter
9 years ago

You're only allowed to call animations from LocalScripts, it'd work in a TestServer because a TestServer cannot tell the difference between Local and Global. Whereas Server testing does.

Ad
Log in to vote
0
Answered by 9 years ago

Try putting it in a LocalScript. The animation works in a regular script because it is a server, but in a Client, you'd need a LocalScript.

Answer this question