I have a script inside a part that pushes players away when touched (one way door). When running in-game, nothing happens. Here is the code. Does FE affect how this works?

door = script.Parent

function onTouch(hit)
	if hit.Parent == nil then return end
	local h = hit.Parent:FindFirstChild("Humanoid")
	if h ~= nil then
		hit.Parent.HumanoidRootPart.Velocity=door.CFrame.lookVector * 150
	end
end
door.Touched:connect(onTouch)

1 comment

0

"connect" is deprecated. Use ":Connect" instead.