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

how i need to do health only one player? [BEGGINER]

what i need do to in StarterPlayerScripts for to do inf health or something

2 comments

0

Can your question be more descriptive?

0

^

3 answers

✓ Accepted answer

Your question is very non-descriptive, so I assuming you want to change people's health. Best way to do this is a ServerScript in ServerScriptService, in which waits for a Character to be added to modify the Humanoid.

-- [[ SERVICES ]] --

Players = game:GetService('Players')

-- [[ VARIABLES ]] --

local healthValue = 9999 -- how much you want the health to be modified to, if you want them **godded**, change to **math.huge**

-- [[ MAIN SCRIPT ]] --

Players.PlayerAdded:Connect(function(Player) -- Fire function when player joins.
	Player.CharacterAdded:Connect(function(Character) -- Fire function when character is added to workspace
		local Humanoid = Character:WaitForChild('Humanoid') -- wait for the humanoid to load in
		if Player.Name == 'Noob123' then
			Humanoid.MaxHealth = healthValue -- change maxhealth first, always
			Humanoid.Health = healthValue -- now change the health
		end
	end)
end)

5 comments

0

can u say how to do it only for one player but in all be normal health

0

but it works perfect thanks

0

game.Workspace.wattome.Humanoid.MaxHealth = 1500

0

That's stupid, all you need is to put a Humanoid named StarterHumanoid with the properties you want and players will always have that humanoid

0

I have edited it accordingly for one player. @programmer. I have done it server side to prevent exploiters, since they can abuse LocalScripts.

Hey hello there!

There a script to make it changes everyone's health become infinite.

This is the script, place it anywhere you like!

script.Parent = workspace

game.Players.PlayerAdded:Connect(function(plr)
	plr:FindFirstChild("Humanoid").MaxHealth = 99999999999999
	plr:FindFirstChild("Humanoid").Health = 99999999999999
end)

Hope I helped, bye!

If my code was incorrect, comment below! Bye:)

5 comments

0

thanks for fast responding

1

Yeah, this is wrong.

0

That doesn't work. do plr:FindFirstChild("Character").Humanoid.MaxHealth = 999999999999

0

That doesn't work either

0

That's stupid, all you need is to put a Humanoid named StarterHumanoid with the properties you want and players will always have that humanoid

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