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

How do I health a certain player? [HELP!] [closed]

Asked by 6 years ago

I tried:

game.Workspace.PlayerNameHere.maxhealth=100


but i don't think thats the correct line. i already made a thread about this but none of the lines that were given to me worked ):

does it need a function?

0
Just as @AlphaGamer150 said you need to access the Humanoid of the player, also Lua is case sensitive.. mixgingengerina10 223 — 6y
0
Also... how do I health??? WHAT. Learn English. AlphaGamer150 101 — 6y
0
Maybe the studios script service is broken..? Still not working D: ScriptingHelper1038 -13 — 6y
0
How do you know its not working? mixgingengerina10 223 — 6y
View all comments (4 more)
0
Is there an error? AlphaGamer150 101 — 6y
0
An error would tell us what your doing wrong. AlphaGamer150 101 — 6y
0
@ScriptingHelper1038 Here, go gain some braincells... https://www.robloxdev.com/learn-roblox/coding-scripts AlphaGamer150 101 — 6y
0
Can someone please close this question? She probably took the answer and doesn't want to accept our answers D: mixgingengerina10 223 — 6y

Closed as Too Broad by RubenKan

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

You are referencing the player modal, to change the max health of a player, you need to reference the humanoid, like this: game.Workspace.PlayerNameHere.Humanoid.MaxHealth = 100

To give a player a certain amount of health when they join:

game.Players:PlayerAdded:Connect(function(player)
    player.Character:WaitForChild("Humanoid").MaxHealth = Number
end)
0
This is not working either, do I have to put into ServerScriptService? ScriptingHelper1038 -13 — 6y
0
Basically, I'm trying to health ONE CERTAIN player in a server when he/she joins a server. The automated health is 100 but I'd like to change that to 150 max health. I don't know why this is hard for me to do ): ScriptingHelper1038 -13 — 6y
0
Make sure its in a normal script not a local one mixgingengerina10 223 — 6y
0
I have updated my answer to include a basic function in witch it can be accomplished. AlphaGamer150 101 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

try this

script:

game.Players.PlayerAdded:Connect(function(p)
 p.CharacterAdded:Connect(function(c)
  if p.Name == "YOURNAME" then
    c.Humanoid.MaxHealth = 150
end
end)
end)  

0
That is very over complicated. AlphaGamer150 101 — 6y
0
Not really, its quite basic to me. mixgingengerina10 223 — 6y
0
Wait something like CharacterAdded exists... you learn something new everyday. AlphaGamer150 101 — 6y
0
Lol. mixgingengerina10 223 — 6y
0
I'm done with this idiot. AlphaGamer150 101 — 6y