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

How do I make it so that toxic fumes won't damage a player with a gas mask?

Asked by 10 years ago

In my game, there are parts with toxic fumes that require a gasmask to pass through. (undamaged, that is) But, I dont know how to make it so that if a player is wearing a gasmask, then the toxic fumes wont damage him. I don't know if this is necessary (or even helps) but I'm new here on this site, so some things that may or may not help: The gas mask is currently a hat, and the fumes are basic bricks that are scripted to do damage when touched.

1
Note: Despite what the other questions are on this website, you're not supposed to post requests despite it being lowly enforced. Bebee2 195 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago
--Define the player
--Define the players character
if character:findFirstChild("GasMask") then
--stuff
end
Ad
Log in to vote
0
Answered by
Bebee2 195
10 years ago

If there is something touching the gas then search for a humanoid. If there is a humanoid then check if they have a gas mask. If they don't, make a debounce and deal damage to the humanoid, wait a set time, then set the debounce back.

Answer this question