I am coding an MMX hilldash fangame.
But as you can see, there is a problem.
When my car explodes, it is supposed to kill the player, respawning the menu.
However, It instead deletes the player and does not show the menu.
This is not the case for the bomb.
Footage:
robloxapp-20240614-1541033.wmv (614.3 KB)
Code:
script.Parent.Touched:Connect(function(OP)
if OP.Name == "RedBomb" then
local Explosion = Instance.new("Explosion")
Explosion.Parent = workspace
Explosion.Position = script.Parent.Position
Explosion.BlastRadius = 100
for i, plr in game.Players:GetPlayers() do
plr.Character:BreakJoints()
end
script:Destroy()
end
end)