The script is disabled. Just remove script.Disable = true…
The best option here is break command it is made to break loops and is very helpful in these conditions you can use it by:
-that wouldnt work? it will just break as soon as it cframes once.
1 Like
You need to add a condition as per your request.
Here you go. I didn’t explain what I did, but hopefully, you will learn from it anyways. It’s simple enough to understand.
local Click = script.Parent
local Breakable = script.Parent.Breakable
local Part = script.Parent.Parent
local Effect = script.Parent.Parent.Effect
Click.MouseClick:Connect(function()
if Breakable.Value == true then
Part.Anchored = false
Effect.Enabled = true
wait(2)
Effect.Enabled = false
Part.Orientation = Vector3.new(45, 0, 0)
local start=tick()
while tick()-start<2 do -- Loop
Part.CFrame = Part.CFrame * CFrame.new(0, 0, .5) -- I adjusted the distance so it doesn't go 600 studs
wait()
end
end
end)