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

How do you have a player gain health from killing someone else?

I want it so if you kill someone you gain back all of your health.

9 comments

0

I tried I swear

0

I'm not trying to make "the world worse", you have made no attempt at this and you still want us to make the code for you

0

Not you

0

Although you too are being extremely rude, I have nearly no experience, I've actually tried a lot of things and used a lot of my time, if it's that simple how about you just solve it instead of being useless and hating on someone who genuinely needs help.

1

Create some code and come back with questions. We're not here to create scripts for you.

0

Although I won't be ignorant like the others, they are right. You should always show some type of attempt in scripting form so we can help you with your own code. We are not here to code for you, we are here to help you code. If you did try, show us what you tried and we can tell you where you made a mistake or misunderstood something in the code.

0

Also, just because you're new doesn't mean you can just ask people for them to script something for you. Always give an attempt, I tried doing stuff the exact same way and I got no where. Always show your mistakes and with your mistakes in that script and we can help you better.

0

This is a forum for asking questions on how to script. Getting help with existing code is not the only valid type of question. You guys should all read the "about" this site before downvoting. Asking how to set a player's health is a perfectly legitimate new user question. Don't assume people are asking you to write the script for them. It's fine to point him in the right direction (general techni

1 answer

Have this function called when the players kills someone. Have it in a server script in the character in the workspace.

local function heal()
	script.Parent.Humanoid.Health = 100
end

It was that easy.

4 comments

0

+1 for not giving fully working code

0

A. I know close to nothing about scripting and I am trying to learn

1

B. It's people like you who don't even try to help people out who make the world worse.

0

It's hard to help people when the person doesn't show an effort to learn. You basically just said what you wanted and that's it.

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