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)
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)
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.
I already fixed it disabling the seats after some time, thank you anyways!
okay, no problem.
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
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.
So what do i do?
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.