local Q=false function getPlayer(Q)local i=game.Players:children()for N=1,#i,1 do if i[N].Character~=nil then if i[N].Character.Humanoid==Q then return i[N]end end end return nil end function putOnArmor(Q)local i=Q.Parent.Torso i.Reflectance=.6 Q.MaxHealth=200 local N=getPlayer(Q)if N~=nil then local Q=Instance.new("\077\101\115\115\097\103\101")Q.Text="\089\111\117 \102\111\117\110\100 \066\097\116\116\108\101 \065\114\109\111\114\033"Q.Parent=N wait(5)Q.Text="\077\097\120 \072\101\097\108\116\104 \068\111\117\098\108\101\100\033"wait(5)Q.Parent=nil end end function hasArmor(Q)return Q.MaxHealth>100 end function onTouched(i)local N=i.Parent:findFirstChild("\072\117\109\097\110\111\105\100")if N~=nil and Q==false then if hasArmor(N)then return end Q=true script.Parent.Parent=nil putOnArmor(N)Q=false end end script.Parent.Touched:connect(onTouched)
-- Touching this Battle Armor doubles you MaxHealth and heals you to full power

local debounce = false

function getPlayer(humanoid)
	-- find the owning player of a humanoid.
	local players = game.Players:children()
	for i = 1, #players do
		if players[i].Character ~= nil then
			if players[i].Character.Humanoid == humanoid then
				return players[i]
			end
		end
	end
	return nil
end

function putOnArmor(humanoid)
	local torso = humanoid.Parent.Torso

	torso.Reflectance = 0.6
	humanoid.MaxHealth = 200

	local player = getPlayer(humanoid)
	if player ~= nil then
		local message = Instance.new("Message")
		message.Text = "You found Battle Armor!"
		message.Parent = player
		wait(5)
		message.Text = "Max Health Doubled!"
		wait(5)
		message.Parent = nil
	end
end

function hasArmor(humanoid)
	return (humanoid.MaxHealth > 100)
end

function onTouched(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	if humanoid ~= nil and debounce == false then
		if hasArmor(humanoid) then
			return
		end
		debounce = true
		script.Parent.Parent = nil
		putOnArmor(humanoid)
		debounce = false
	end
end

script.Parent.Touched:connect(onTouched)
