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

The brick is meant to shoot away when i touch it, but it shoots away when the game starts up. help?

Asked by 6 years ago
Edited 6 years ago

function startBelt ()

while true do

    script.Parent.Velocity = script.Parent.CFrame.lookVector *50

    wait (0.01)

end

end

startBrick = game.Workspace.woof

startBrick.Touched:Connect (startBelt)

1 answer

Log in to vote
0
Answered by 6 years ago
local belt = script.Parent

belt.Touched:connect(function(hit)
    if hit then
        if hit.Parent:FindFirstChild("Humanoid") then
        script.Parent.Velocity = script.Parent.CFrame.lookVector *50
        wait(0.01)
        end
    end
end)
0
Try that. It may work if line 6 is the way you want it to shoot. TickTockTheory 106 — 6y
0
Put it inside the part you want to touch too. TickTockTheory 106 — 6y
0
Leave an upvote if it works! :) TickTockTheory 106 — 6y
Ad

Answer this question