I've created an NPC and coded a script (not a localscript) and whenever I press test or Team test, I can see the animation clearly while my friend does not see the animation on the NPC at all, why could this be happening? I put it on a dummy on the workspace, and inside that dummy, I inserted a script and inside that, I inserted the Animation ID. Down below is the code I am using but only I can see it, can anyone help me out with this? I am also very new to coding so Im sorry!
local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local dance = humanoid:LoadAnimation(animation)
dance:Play()
I recommend adding a StringValue to set it to "Idle" and put it in the NPC I'll give you an example of the type of code that I used for my script for my NPCs
local Animation = script.Parent:WaitForChild("Animation") local Humanoid = script.Parent:WaitForChild("Humanoid") local AnimationPlay = Humanoid:LoadAnimation(Animation) function Anim() if script.Parent.Stance.Value == "Idle" then AnimationPlay:Stop() wait(0) AnimationPlay:Play() end end Anim()
Thats the problem, Ur script is perfectly fine if u can see it, Except its a serverside script and animations are held by the local scripts, If u set the animation script to a local script it should work