Well, I am trying to make an oxygen system, but I ran in other problem…
The problem is…
…that the part detects the whole character of person (or it will also other entities)
THE CODE I am using:
local part = game.Workspace.woer
local ChildDescentHead = game.Players.LocalPlayer.Character.PrimaryPart
local function onTouch(ChildDescentHead)
if part.Touched then
wait(1)
script.Parent.Value -=1
repeat until part.TouchEnded
end
end
local function onTouchEnded(ChildDescentHead)
script.Parent.Value = 45
end
part.Touched:Connect(onTouch)
part.TouchEnded:Connect(onTouchEnded)