|
is it possible to make a brick that kills ONLY humanoids and nothing else? I have searched all over, and all I have found is LAVA, and that blows up or kills my car. PLEASE HELP!! |
|
|
Put this in your brick, try this (Not 100% sure it works tell me if it doesnt):
function OnTouched(hit)
human = hit.Parent.Humanoid
if hit ~= nil then
human:remove()
end
end
script.Parent.Touched:connect(OnTouched) |
|
AlgoritmiJoin Date: 2007-09-22 Post Count: 528 |
change the name called Humanoid of the thing you want not to die, to Alien or whatever |
|
AlgoritmiJoin Date: 2007-09-22 Post Count: 528 |
though this makes me wonder, why does your car have a humanoid of its own???? |
|
chris1989Join Date: 2007-11-30 Post Count: 2520 |
function OnTouched(hit)
h = hit.Parent:findFirstChild("Humanoid")
if hit ~= nil then
h.Health = 0
end
end
script.Parent.Touched:connect(OnTouched)
thats more specific will only kill the humanoid not remove it |
|
|
THX! I did what LinkIsahh (srry if I misspelled ur name i did it from memory) BUT I CHANGED PART OF IT!! WOW!! I suck at scripting, but I figured it out. I changed it from the Human:REmove to Human.Health = 0 and it worked! THX!!! |
|
TyphoonIIJoin Date: 2008-01-03 Post Count: 25195 |
yoiano, the car doesn't have its own humanoid. I found out on solo mode that when your tool is on to drive the car or plane that it becomes a child of the player under the Workspace. That's why planes disappear with the player if it crashes and kills the player. |
|
|
wait, so this is sort of linked with my other post, can I make a brick that fines my "child", e.g. the car, and have it anchor the car but not me. |
|
|
I think your looking for a hit.name == "Wheel" then hit.Anchored = true? For your car? I will try to do something |
|
|
??? I dont understan scripting that much, but im O.K.... PLZ HELP |
|