Can one change the humanoid state from a server script?

I have tried to use ChangeState and SetStateEnabled but they only seem to work from a local script. So is there any way to change the state of the humanoid from a server script?

1 Like

I don’t see why you couldn’t. Have you actually tried your theory?

I have. But maybe the ones im trying are the problem. I’m trying to set HumanoidStateType.Physics from a server script.

You have to set it with Enum.HumanoidStateType.Physics

i know. Have you tried to do it?

You need to try and do it, not me. I’m not the person that needs the help.

If you need an example here you go:

game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics,true)
    end)
end)

i already told you that i did.

Also

That’s not a good logic if you try you may figure how to solve the issue

also also

Doesn’t work as i told you.

1 Like

Alright, I’m a bit late, but I’ve also been running into this problem. After viewing the pages of Humanoid:GetState(), Humanoid:SetStateEnabled(), and Humanoid:ChangeState() I realized they only provide code samples that state that the code should be placed in a local script. This, along with my own failure to make the humanoid enter the Physics state, leads me to believe it is not possible use on a Server Script. It’s pretty disappointing since it’s the only thing that’s keeping me from rag-dolling the player from only a server script.

2 Likes

You know I happen to be trying to do the same thing and its having really weird behavior. I’m managing to set an NPC’s state to Physics on the server, which works for a while until suddenly it completely stops working and I’m left with it only being able to go into non-physics states. It works fine for players since I just fire the client of the hit player and do it there, but for NPCs, its a big issue since its very inconsistent as mentioned before.

found a fix, if you set network ownership to server for the primarypart of the NPC, it works on server.

4 Likes