Module –
local Bar = {}
local Values = {}
function Bar:Add (humanoid,Number,TypeOfBar,Name)
print(TypeOfBar)
local att = humanoid:GetAttribute(TypeOfBar)
humanoid:SetAttribute(TypeOfBar, att + Number)
table.insert(Values,TypeOfBar)
table.insert(Values,Name)
table.insert(Values,humanoid)
table.insert(Values,Number)
end
function Bar:GetValue ()
return Values
end
return Bar`
Script: `
local Module = require(game.ReplicatedFirst.BarsModule)
script.Parent.Touched:Connect(function(h)
if h.Parent:FindFirstChild("Humanoid") then
local human = h.Parent:FindFirstChild("Humanoid")
while wait() do
Module:Add(human,10,"Oxygen",script.Parent.Name)
if script.Parent.TouchEnded then
break
end
end
end
end)`