local part = script.Parent -- path part you want them be on, in my case its the scripts parent
local touching = {}
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
if touching[2] then return end
touching = {hit.Parent.Humanoid.Health,player}
hit.Parent.Humanoid.Health = math.huge
end)
part.TouchEnded:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if not player then return end
if not touching[2]~= player then return end
hit.Parent.Humanoid.Health = touching[1]
touching = {}
end)
local Circle = script.Parent
local Debounce = false
local function Touching(part)
local parent = part.Parent
if debounce == false then
debounce = true
if game.Players:GetPlayerFromCharacter(parent) then
parent.Humanoid.MaxHealth = 200
wait(amount)
parent.Humanoid.MaxHealth = 100
end
end
end
local Circle = script.Parent
local function TouchStarted(part)
local parent = part.Parent
if game.Players:GetPlayerFromCharacter(parent) then
parent.Humanoid.MaxHealth = 200
end
end
local function TouchEnded(part)
local parent = part.Parent
if game.Players:GetPlayerFromCharacter(parent) then
parent.Humanoid.MaxHealth = 100
end
end
Circle.TouchEnded:Connect(TouchEnded)
Circle.Touched:Connect(TouchStarted)
I haven’t tested this but this might work
If you want Inf helath change 200 to inf
Thanks to all of you that took the time out of your day to help me… I’m sorry to waste your time but I know very little about scripting and this is a big help. I really appreciate it. Again, thanks.