Hello developers! I’m trying to make a plane kit for a game. I want to make the plane crashable. My idea is to have an invisible block in the ground and if the plane hits the block at a specific speed the plane will explode and the client will die. Does someone know how to do that? I’ve searched on Youtube but I found nothing. I searched on the forum but found nothing.
Example: Ok, so if we say that I’m flying in 160 knots, then I pitch down and hit the ground. When I hit the ground the plane explodes and I die. And the plane burst into flames. After 5 seconds the plane despawns.
Does someone have any code for this or any tutorial? I would truly appreciate that. I know that you shouldn’t ask for codes here but there’s no other channel.
Thanks for reading😃!
Place a server script in the invisible block
and try this:
script.Parent.Touched:Connect(function(hit)
if not hit.Parent:FindFirstChild("Humanoid") then
local Explosion = Instance.new("Explosion")
Explosion.Parent = game.Workspace
Explosion.Position = script.Parent.Position
end
end)
When I hit the ground the explosions aren’t hitting the plane, when I hit the ground it starts to explode in the middle of the map not where the plane is.
And it’s exploding when my plane doesn’t even move, can you change that so if my plane hits the ground in 100 knots it explodes?
Couldn’t you just do
local connection
connection = plane.CrashDetector.Touched:Connect(function(hit)
if hit:IsA("BasePart") and plane.State == "Flying" then
local explosion = Instance.new("Explosion", plane.CrashDetector)
connection:Disconnect()
end
end
That code was good but the explosions were happening at the wrong place, if you could fix that I would be really glad. This is what is happening for me: Just a not normal crash in studio - Clipped with Medal.tv