I’ve been trying to make a function where a part starts spinning and overtime it gets faster and faster. If a local player dies then that part stops and starts spinning again at a slow pace and then gets faster overtime. Here I have a function in a local script.
local Beam = game:GetService("ReplicatedStorage"):WaitForChild("Beam"):Clone()
Beam.Parent = workspace.CurrentCamera
local function Move()
local speed = 0.001
local something = true
while something do
task.wait()
Beam.CFrame = Beam.CFrame * CFrame.fromEulerAnglesXYZ(speed, 0, 0)
speed = math.clamp(speed + (0.001 / 90), 0.001, 30)
Player.Character.Humanoid.Died:Connect(function()
wait(2)
something = false
end)
end
end
The part which is the beam starts spinning when the function is called and gets faster and faster overtime. The only problem I’m facing is whenever the local player dies that the part doesn’t stop and doesn’t start spinning again at a slow pace. I was wondering how I could possibly fix this. Thank you.