Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Workspace.Car.Script:6: Expected ')' (to close '(' at line 3), got <eof>?

Hello, I am trying to make a infinite health script and it is not working. It gives me an error (title)

local human = script.Parent:WaitForChild("Humanoid")
human.HealthChanged:connect(function(health)
wait()
human.Health = human.MaxHealth
end

3 answers

Like the error says, the script expected you to add a closing ')' at line 5.

If we remove the functions content that you passed as a argument, it becomes more apparent to what's actually going on.

human.HealthChanged:connect(yourFunction 

Here's how to fix your problem


local human = script.Parent:WaitForChild("Humanoid")
human.HealthChanged:connect(function(health)
	wait()
	human.Health = human.MaxHealth
end) -- this closing parentheses requires to be added

I'd encourage you to tab your code properly next time, as it becomes easier to read.

Humanoid.MaxHealth = math.huge
Humanoid.Health = math.huge
print(math.huge) -- inf

Try this!


local human = script.Parent:FindFirstChild("Humanoid")
human.MaxHealth = math.huge
human.Health = math.huge


This discussion is preserved as it was. New answers, comments, and votes are closed.