local healthpack = script.Parent
local active = true -- This means that the healthpack is ready to be picked up (If you want it to start off as inactive then just set to false and make a countdown for it to ready up)
function GiveHealth(limb)
if active == false then return end -- Don't do anything if it's not appearing
if game.Players:FindFirstChild(limb.Parent.Name) then -- If the part touching belongs to a player in the server then...
local items = {} -- let's store all the parts we need to make visible again here
active = false -- Right away let's deactivate the healthpack
for _,item in pairs(healthpack:GetChildren()) do
if item:IsA("Part") then
item.Transparency = 1
items[#items+1] = item
end
end
local humanoid = limb.Parent.Humanoid
hu#################u############### # #-##r##owever much you want to give it
wait(6)
for _,item in ipairs(items) do
item.Transparency = 0
end
end
end
healthpack.Touched:connect(GiveHealth) -- Let's connect this sucker
Haven't tested it yet but it should work. Just make sure that all the parts you want to be invisible to be direct children of the model that the script is in. Other than that this script shouldn't have errors. I hope :P |