how do i break this loop after 4 seconds
local shaking = false
wait(6)
if shaking == false then
while true do
wait()
script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * CFrame.Angles(0.003,0,0))
if shaking == false then
wait(4)
shaking = true
break
end
end
end
please help me.