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

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

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

2 comments

0

Are you using a LocalScript :)?

0

No I'm using a regular script. I tried using a local script but that doesn't work in either solo or multiplayer.

1 answer

✓ Accepted answer

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

2 comments

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.

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 ^^

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