Having issues with my NPC

I want to make this NPC dance with an emote.

The issue is that’s he does not dance when in client mode or in game, but he dances when I’m in server mode on studio.
I have been looking on internet and docs, but still having issue with it.

The code :

local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local hum = script.Parent:WaitForChild("Humanoid")
if hum then
    print("Success")
else
	print("No Humanoid")
end
local humanim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))

if enabled.Value == true then
	humanim:Play()
	humanim.Looped = true
	humanim:AdjustSpeed(sp.Value)
end 

The NPC ingame or in client mode, standing like this. He’s unanchored.
image

In server mode.
image

If anyone has an idea why it’s not working, feel free to tell me :')

Thanks.

2 Likes

Are you running the animation in a client or on the server?

1 Like

I’m running it though a server script. Should have said it before, my bad.

1 Like

Try playing the animation through a local script.

1 Like

It did not fix, and no error does show in the output.
Howewer, it does not work anymore on server side when using a local script.

1 Like

I’ve fixed the issue by coding the thing in another way, and it seems to work correctly. Thanks @goldenty34 for the help.

2 Likes

No problem. Apologies I couldn’t help initially.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.