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

Button1Down not working?

The first bit is working, rotating the player to the mouse, but the second bit is not. When I mouseclick it doesn't print "clicked". No idea why

held = false
mouse = game.Players.LocalPlayer:GetMouse()
torso = game.Players.LocalPlayer.Character:WaitForChild("Torso")

while wait() do
	torso.CFrame = CFrame.new(torso.Position, mouse.Hit.p)
end

mouse.Button1Down:connect(function() --here
	print("clicked")
	held = true
	while held == true do
		local velocity = Instance.new("BodyAngularVelocity")
		velocity.Parent = torso
		velocity.AngularVelocity = mouse.Hit.p
		wait()
	end
end)

1 comment

0

You need a mouse.Button1Up event to change the help variable.

2 answers

✓ Accepted answer

on line 09 put mouse.MouseButton1Down then the rest

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