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

Button1Down not working?

Asked by 7 years ago

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)
0
You need a mouse.Button1Up event to change the help variable. GoldenPhysics 474 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

on line 09 put mouse.MouseButton1Down then the rest

Ad
Log in to vote
0
Answered by 7 years ago

Its just that the loop never breaks, nvm

Answer this question