I am really dumb when it comes to CFrame, so sorry if this looks noobish.
local cd = script.Parent.ClickDetector
local spinningpart = script.Parent.Parent.Parent.SpinningPart
cd.MouseClick:Connect(function()
while true do
wait()
script.Parent:SetPrimaryPartCFrame(script.Parent.Main.CFrame * CFrame.fromEulerAnglesXYZ(500,0,0))
end
end)
local isOn = true
function on()
isOn = true
cd.MouseClick:Connect(function()
while true do
wait()
script.Parent:SetPrimaryPartCFrame(script.Parent.Main.CFrame * CFrame.fromEulerAnglesXYZ(500,0,0))
end
end)
function off()
isOn = false
cd.MouseClick:Connect(function()
while true do
wait()
script.Parent:SetPrimaryPartCFrame(script.Parent.Main.CFrame * CFrame.fromEulerAnglesXYZ(0,0,0))
end
end)
function onClicked()
if isOn == true then off() else on() end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
on()
Thanks if you can help.

2 comments
What would be a good way to be able to click it on and off assuming I'm using the first script?
Edited the top example