Humanoids remove/destroy seats when they jump


#1

To elaborate onto the issue at hand, when a NPC (Normal player character with a humanoid and all just not controlled by a player) jumps, It seems to basically ‘eat’ the seat, taking it with them and essentially making the seat useless.

Here’s some code I use to check when they sit, It seems to make them jump but still ends up eating said seat/destroying it.

script.Parent.Humanoid.Changed:connect(function()
	if script.Parent.Humanoid.Sit == true then
		script.Parent.Humanoid.Jump = true
		script.Parent.Humanoid.Sit = false
		--script.Parent.Brain.Input:Invoke("Die")
	end
end)

Here’s an example of what they are left doing after they jump.
image

Any help would be appreciated!


#2

I tested your code and the seat isn’t getting destroyed, but rather the NPC is not standing up.

script.Parent.Humanoid:GetPropertyChangedSignal("Sit"):Connect(function()
	print("Sit Changed")
	if script.Parent.Humanoid.Sit == true then
		wait(0.5)
		script.Parent.Humanoid.Jump = true
		script.Parent.Humanoid.Sit = false
		script.Parent.Humanoid.PlatformStand = true
		wait()
		script.Parent.Humanoid.PlatformStand = false
		print("Sit True")
	else
		print("Sit False")
	end
end)

This is the code I used to debug and get the expected results, but I believe there are potential improvements to it. Apparently, if you set jump to true, the NPC will not jump, but freeze instead and stay in a state between jump and sit.


#3

Just tested this snipit of code, it seems to almost flawlessly!

Thanks so much for your help !