generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would I do this?

Previous Thread :: Next Thread 
BreadJokess is not online. BreadJokess
Joined: 15 Jun 2011
Total Posts: 978
04 Jul 2016 07:11 PM
This is probably very easy to do, but I'm quite inexperienced with scripting lol
I basically want to increase max health with a player's level. Like, say at level 1 they would have 100 health, and each level would increase their health by, say, 10.


Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
04 Jul 2016 07:12 PM
humanoid.MaxHealth = 90 + level * 10

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
BreadJokess is not online. BreadJokess
Joined: 15 Jun 2011
Total Posts: 978
04 Jul 2016 07:29 PM
It doesn't appear to be working. Am I just doing it wrong? here's what I have:

function onLevelUp(player, XP, level)
player.Character.humanoid.MaxHealth = 90 + player.leaderstays.level * 10 -- max health
player.Character.humanoid.Health = 90 + player.leaderstays.level * 10 -- heal upon leveling
end


Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
04 Jul 2016 07:30 PM
function onLevelUp(player, XP, level)
player.Character.Humanoid.MaxHealth = 90 + player.leaderstats.level * 10
player.Character.Humanoid.Health = 90 + player.leaderstats.level * 10
end

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
doggy00 is not online. doggy00
Joined: 11 Jan 2011
Total Posts: 3571
04 Jul 2016 07:31 PM
Humanoid is case-sensitive, I believe. Also, this script would probably be better for the MaxHealth.

while true do
wait()
player.Character.Humanoid.MaxHealth = 90 + level * 10



--what should be siggy be?
Report Abuse
doggy00 is not online. doggy00
Joined: 11 Jan 2011
Total Posts: 3571
04 Jul 2016 07:32 PM
add an end to that script, also.


--what should be siggy be?
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
04 Jul 2016 07:32 PM
@doggy
Using loops is stupid when it's unnecessary. Also, you forgot an end.

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
doggy00 is not online. doggy00
Joined: 11 Jan 2011
Total Posts: 3571
04 Jul 2016 07:33 PM
Yeah it's just easier and I'm a lazy guy.


--what should be siggy be?
Report Abuse
BreadJokess is not online. BreadJokess
Joined: 15 Jun 2011
Total Posts: 978
04 Jul 2016 07:33 PM
Ah, forgot it was case sensitive. Thanks, I'll give it a shot


Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
04 Jul 2016 07:35 PM
That wasn't the only problem with your code.

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
BreadJokess is not online. BreadJokess
Joined: 15 Jun 2011
Total Posts: 978
04 Jul 2016 07:36 PM
"leaderstays". just noticed.
heh.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image