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

The script keeps rotating, help??

Asked by 8 years ago
debounce = false

script.Parent.Parent.SpawnLocation.ClickDetector.MouseClick:connect(function(yoo)
if debounce == false then
debounce = true
local target = workspace.CIRCLETHIS
local camera = workspace.CurrentCamera
camera.CameraSubject = target
local angle = 0
    while wait() do
        camera.CoordinateFrame = CFrame.new(target.Position)
                               * CFrame.Angles(0, angle, 0) 
                               * CFrame.new(0, 0, -.1)       
        angle = angle + math.rad(1)
    end
end
end)

workspace.CIRCLETHIS.ClickDetector.MouseClick:connect(function(click)
if debounce == true then
local player = game.Players.LocalPlayer.Character:FindFirstChild("Torso")
local target = player
local camera = workspace.CurrentCamera
camera.CameraSubject = target
debounce = false
end
end)

After I click the part it starts circling, it returns to me but it doesn't stop spinning,

Answer this question