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

Kill brick doesnt work while in car?

Asked by 4 years ago

So i made a kill brick that kills you, but when you are in a car, it doesnt work. Please help

Kill brick:

script.Parent.Touched:Connect(function(hit)
     if hit.Parent:FindFirstChild("Humanoid") then
          hit.Parent:BreakJoints()
     end
end)

0
That's probably because you're not directly touching the kill brick. The car is touching the kill brick - and the car does not have a Humanoid. nilVector 812 — 4y
0
So what do i do? Shadic1270 136 — 4y
0
Well you could try using .Magnitude instead. Simple loop through players and find how close each player is to the part, and if they are closer than say 5 studs, they die. You could also simply increase the height or width of the brick while keeping cancollide off. cruizer_snowman 117 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Like what nilVector said, you are not touching the kill brick directly. What I would do is keep the kill brick but change the size to make it at least reach the seat in the car you are using (brick can be bigger) and turn CanCollide off, along with changing the Transparency property to 1 if you want the brick to be hidden.

0
I already fixed it disabling the seats after some time, thank you anyways! Shadic1270 136 — 4y
0
okay, no problem. Humanitoria 2 — 4y
Ad

Answer this question