Hiya Developers!
For some reason, my local function has a red line under the “local”, although im not sure why. All help is appreciated.
local MAX_HEALTH = 100
local ENABLED_TRANSPARENCY = 0.4
local DISABLED_TRANSPARENCY = 0.9
local COOLDOWN = 20
local healthPickUpsFolder = workspace:WaitForChild("Healthpick")
local healthPickup = healthPickUpsFolder:GetChildren() -
local function Healthpickup (otherpart, Healthpickup) -- THE LOCAL HERE HAS A RED LINE
if Healthpickup:GetAttribuite("Enabled") then
local character = otherpart.Parent
local humanoid = character:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.Health = MAX_HEALTH
Healthpickup:GetAttribuite("Enabled", false)
Healthpickup.Transparency = DISABLED_TRANSPARENCY
wait(COOLDOWN)
Healthpickup.Transparency = ENABLED_TRANSPARENCY
Healthpickup:GetAttribuite("Enabled", true)
end
end
end
for _, healthpickups in ipairs(Healthpickup) do
Healthpickup.Touched:Connect(function(otherpart)
Healthpickup(otherpart, Healthpickup)
Healthpickup:SetAttribuite("Enabled", true)
end)
end
Thanks!