Hello, im making a cannon script where you can control it from a gui, but there is a problem, when i want to rotate i made it so you can hold it and it keeps rotating but it just does it once I tried this
local touching = false
script.Parent.MouseButton1Click:Connect(function()
touching = true
coroutine.resume(coroutine.create(function()
repeat
script.Parent.Parent.fire:FireServer("rotate","left")
wait(0.1)
until touching == false
end))
end)
script.Parent.MouseButton1Up:Connect(function()
touching = false
end)
What could i do to fix this problem?

1 comment
Oml i didn't notice that thanks