

TimerThreads = task.spawn(ChangeTime, v) -Creates and runs thread, adding it to the table. I’ve modified your Delkit() and remote handler to do this: -Store threads in a lookup table where the keys are the TextLabels and the values are the threads. In order to access previous threads, they’ll need to be stored in a table that can be accessed elsewhere. The co variable is being overwritten with every new thread created. What is the issue? Include screenshots / videos if possible!.Remotes:WaitForChild("ResetRewardCooldown").OnClientEvent:Connect(function()Ĭoroutine.close(co) - kill the coroutines just kills 1 of them?

This is a RemoteEvent fired Every 10 second V.Text = format_time(unFormat_time(v.Text) - 1)įor i,v in pairs(frame:GetDescendants()) doĬo = coroutine.create(ChangeTime,v) -Creates coroutineĬoroutine.resume(co,v) - Starts coroutine V.Text = format_time(math.abs(( Module.Info - ))) Hi! I am trying to kill every coroutine created by my script

What do you want to achieve? Keep it simple and clear!.Local function OnServerEvent (LocalPlayer,PlayerList) local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent") If the script bellow works then use that instead. RemoteEvent.OnClientEvent:Connect(OnServerEvent) Local function OnServerEvent (LocalPlayer,Player) Insert a remoteevent in the replicatedstorage then a script in the serverstorage and write this script in that. Local LocalPlayer = įor i, Player in pairs(game.Players:GetPlayers()) do Local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
