Working on making an oxygen system for a game. Magnitude works fine for planets, but for ships and shuttles I need to use Zones of some sort for each individual room and hallway. I need to add a method to check if the player is no longer in the ToucherPart to delete the Oxygen Value.
while task.wait(1) do -- Time between damage taken. Change it to whatever you want.
local results = workspace:GetPartsInPart(ToucherPart)
local players = {}
for _, part in pairs(results) do
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid and not players[part.Parent] then
players[part.Parent] = true
print (part.Name)
local Oxygen = part.Parent:FindFirstChild(SO.Name)
if not Oxygen then
print ("Cloning Oxygen To Character")
SO:Clone().Parent = part.Parent
end
end
end
end
