I’ve been using event based delays in my scripts recently, but I wonder if there were any alternatives to the way I’ve been doing them. I’ve been using these event based delays because while loops checking each frame turned out to be too performance heavy.
local Bind = Instance.new("BindableEvent")
local ConTable = {
Char.Humanoid.Died:Connect(function()
Bind:Fire()
end),
OtherEvent:Connect(function()
Bind:Fire()
end)
}
Bind.Event:Wait()
Bind:Destroy()
for i = 1, #ConTable do
ConTable[i]:Disconnect()
end
I’m doing this per each player and around once per half a second