How would I change the state of a dummy

I want to try to :SetState() the humanoid of a dummy in workspace, i’ve tried multiple things and can’t really come up with anything for the fact that :SetState() only works locally and local scripts won’t work in the dummy.

2 Likes

But what if you set the network owner of the dummy to the player itself? That might enable you to then set the state of it local-sided. Atleast I think.

Not sure I could try it.

Turns out that it works serversided for dummies

Could you please be more descriptive, and explain in more detail on what happened, so others can learn from this thread?

Ok nevermind it wasnt always working serversided so I switched it to fireallclients and its working more but not all the time, it might just be luck.

Im trying to get a dummy in workspace to get its state changed

If it works sometimes but not always and you’re setting it on the client, you probably need a client to have network ownership because the server is taking ownership of the dummy, but it’s only set on the clients.

I have not found a Humanoid:SetState() method, so I am assuming you are referring to ChangeState.

Afaik, this method does work on the server. You just have to set the network ownership of the dummy to the server, or nil.

Since the character is an assembly, you can set the network ownership of the HumanoidRootPart for it to work.

local dummy = workspace.Proligant 
local humanoid = dummy.Humanoid

dummy.HumanoidRootPart:SetNetworkOwner(nil) -- Gives server network ownership
 
-- I used this to test changing the state.
while true do
	humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
	
	wait(1)
end
1 Like