Hello! I was following a tutorial for a health pickup when I encountered an error.
local MAX_HEALTH = 100
local healthPickupsFolder = workspace:WaitForChild("HealthPickups")
local healthPickups = healthPickupsFolder:GetChildren()
local function onTouchHealthPickup(otherPart, healthPickup)
local character = otherPart.Parent
local humanoid = character:FindFirstChildWhichIsA("Humanoid")
if humanoid then
humanoid.Health = MAX_HEALTH
end
end
for _, healthPickup in ipairs(healthPickups) do
healthPickup.Touched:Connect(function(otherPart)
onTouchHealthPickup(otherPart, healthPickup)
end
Here’s the error message:
17:53:48.474 ServerScriptService.PickupManager:18: Expected ')' (to close '(' at line 15), got <eof> - Studio - PickupManager:18
I’m assuming the error has something to do with the second parameter or something related. Can anyone help me out?
Thanks