Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

If A Car hits/goes through the part it destroys?

Asked by 4 years ago
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
wait(0.1)
script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        hit.Parent.HumanoidRootPart.CFrame = game.Workspace:FindFirstChild(tostring(player.leaderstats.Stage.Value)).CC.CFrame

   end
end)
end)
end)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
wait(0.1)
script.Parent.Touched:Connect(function(hit)
   if hit.Parent:FindFirstChild("Jeep") then
      hit.Parent:Destroy()
end
end)
end)
end)


I want this to be able to detect that a car that has hit/went through the part and then destroy() the car.

When people drive a car off the edge they go through/hit a part and they teleport with the car to the location?? (Don't want this to happend)

0
is the Model of the car called jeep if so you should do if hit.Parent.Name == "Jeep" then sturdy2004 110 — 4y

Answer this question