When I reset, everything works fine, the character only respawns when it fires the ‘RespawnRequest’ RemoteEvent (Don’t worry, exploiters can’t abuse it)
And I’ve recently added an airstrike into my game, (Roblox’s airstrike but remastered, fits with the modern days) but the thing is, when the character dies it automatically respawns after 5 seconds. This isn’t a good thing, since I’ve added a death effect which needs to finish before respawning.
Heres the code:
local Explosion = Instance.new("Explosion")
Explosion.Position = bomb.Model.Position
Explosion.BlastPressure = 0
Explosion.BlastRadius = BLAST_RADIUS
Explosion.DestroyJointRadiusPercent = 0
Explosion.ExplosionType = Enum.ExplosionType.NoCraters
Explosion.Hit:connect(function(hit)
local v = hit.Parent
if not v:FindFirstChild("Humanoid") or not v:FindFirstChild("HumanoidRootPart") or not v:FindFirstChild("Torso") then return end
local distance = (Explosion.Position - v.HumanoidRootPart.Position).Magnitude
if distance < 35 then
ReplicatedStorage.Remotes.GoreThread:FireAllClients(v.HumanoidRootPart, v.HumanoidRootPart.Position, "Explode", 100)
ReplicatedStorage.Remotes.GoreThread:FireAllClients(v.HumanoidRootPart, v.HumanoidRootPart.Position, "Explode", 100)
v:BreakJoints()
for i,v in pairs(v:GetChildren()) do
if v:IsA("BasePart") then
v.Velocity = Vector3.new(Random.new():NextInteger(-100,100), Random.new():NextInteger(90,100), Random.new():NextInteger(-100,100))
end
end
end
end)