Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to push players in FE?

Asked by 5 years ago

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)
0
"connect" is deprecated. Use ":Connect" instead. piRadians 297 — 5y

Answer this question