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

My script only works in solo player and not in multiplayer. How do I fix this?

Asked by 7 years ago

Hi, each time I try and run a animation onto a NPC, it works in studio however it never works when I play the actual game multiplayer. I've experienced this a few times, often I can fix it but this time I couldn't. Is there any chance someone could help me out?

local Anim = script.Parent:WaitForChild('Animate')

repeat wait() until Anim

local AnimTrack = script.Parent.Humanoid:LoadAnimation(Anim)

AnimTrack:Play()

This is the code I had. Thank you to anyone who answers

0
Are you using a LocalScript :)? JohnnyS_Sinns 27 — 7y
0
No I'm using a regular script. I tried using a local script but that doesn't work in either solo or multiplayer. Kakitoku 32 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

I was dealing with something similar a few days ago.

Check out the Answer of "OldPalHappy" on this question:

https://scriptinghelpers.org/questions/41303/serverscriptservicescript4-attempt-to-index-field-localplayer-a-nil-value

You can read more about it on the ScriptingHelper guides area:

Server Client Relationship in Roblox

0
I checked out the answer, the difference is I am not addressing a specific player, instead I am trying to animate a dummy inside the workspace. Kakitoku 32 — 7y
0
Oh thanks so much actually. I read the server client relationship link and I understand it, it works now. I was using the Client world and now I got so much to learn. Thank you so much JohnnyS_Sinns ^^ Kakitoku 32 — 7y
Ad

Answer this question