i wonder how to make a brick that spin forever when another brick(button) is clicked and stop when button is clicked again .HOW?
✓ ANSWER ACCEPTED
click to spin a brick and stop when clicked again?
1 answer
✓ Accepted answer
local On = false
local Spinbrick = game.Workspace:FindFirstChild("SpinBrick")--Name of the brick that spins
script.Parent.MouseClick:Connect(function()
if On == false then
On = true
While On = true do
for i=-180,180,1 do
Spinbrick.Rotation = Vector3.new(i,0,0)
wait(0.05)
end
end
else
On = false
end
end
Put this script inside the click detector inside the brick. Remember to use the clickdetector! I hope this works!
1 comment
0
while On == true do; you may also want a break in the for loop.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Have you even made an attempt at doing this? This is something very easy.
It's pretty easy tho
i att but dont work , also im new to scripit tried my best , plz help