Openable doors smacking players through walls?

I’m making a piggy style game that has doors you click to open, but if you’re in the doors way when you open it, it smacks you and sends you flying through a wall or back where you came from

How can I stop the door from throwing the player away?

Here’s the code to open the door -

door.ClickDetector.MouseClick:Connect(function(player)
	if roundInfo.Players:FindFirstChild(player.Name) or roundInfo.Monsters:FindFirstChild(player.Name) then
		if not doorIsOpen and not doorOpening then
			doorOpen:Play()
			doorOpening = true
			openDoorTween:Play()
			openDoorTween.Completed:Wait()
			doorOpening = false
			doorIsOpen = true
		elseif doorIsOpen and not doorOpening then
			doorShut:Play()
			shutDoorTween:Play()
			doorOpening = true
			shutDoorTween.Completed:Wait()
			doorOpening = false
			doorIsOpen = false
		end
	end
end)

PS: The code works perfectly, this is the only problem

Have you tried staying in the door area and activating the door? As I don’t think piggy’s door flying thing was scripted (What I know)

Nevermind, I don’t know what I changed but it works

1 Like