Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
wattome -14
4 years ago

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

0
Can your question be more descriptive? Simpletton 82 — 4y
0
^ DeceptiveCaster 3761 — 4y

3 answers

Log in to vote
0
Answered by
pwx 1581 Moderation Voter
4 years ago
Edited 4 years ago

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)
0
can u say how to do it only for one player but in all be normal health wattome -14 — 4y
0
but it works perfect thanks wattome -14 — 4y
0
game.Workspace.wattome.Humanoid.MaxHealth = 1500 wattome -14 — 4y
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 programmerHere 371 — 4y
0
I have edited it accordingly for one player. @programmer. I have done it server side to prevent exploiters, since they can abuse LocalScripts. pwx 1581 — 4y
Ad
Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
4 years ago

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:)

0
thanks for fast responding wattome -14 — 4y
1
Yeah, this is wrong. DeceptiveCaster 3761 — 4y
0
That doesn't work. do plr:FindFirstChild("Character").Humanoid.MaxHealth = 999999999999 Gojinhan 353 — 4y
0
That doesn't work either programmerHere 371 — 4y
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 programmerHere 371 — 4y
Log in to vote
0
Answered by
wattome -14
4 years ago

can somebody say how to do it only for one player

Answer this question