Changing HumanoidStateType not working

I am trying to change a humanoidState to swimming when colliding with a part just to see if it would work but unfortunately it is not working, I’ve tried changing it to other things such as sitting or free falling but they did not work either, I’m not sure whats causing this and I’ve debugged the script and everything was running and printing.

floodPart.Touched:Connect(function(hit)
		if hit.Parent:FindFirstChild("Humanoid") then
			print(hit.Parent.Name.." Touched part")
			local Humanoid = hit.Parent.Humanoid
			print("swimming")
			Humanoid:SetStateEnabled("GettingUp", false)
			Humanoid:SetStateEnabled("Seated", true)
			print("initiated states")
		end
	end)

Is this a Script or LocalScript?

1 Like

This is in a module that is being run in the server.

HumanoidStateChanges do not take effect unless done by their network owner I believe (handle this on the client)

1 Like

oh really…?? I actually never knew that, I’ll handle it in the client and come back to you :grinning_face_with_smiling_eyes: .

edit (that was the solution, thank you very much :+1:)