Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

3 comments

0

Try that. It may work if line 6 is the way you want it to shoot.

0

Put it inside the part you want to touch too.

0

Leave an upvote if it works! :)

This discussion is preserved as it was. New answers, comments, and votes are closed.