|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 04 Jul 2016 07:33 PM |
Ah, forgot it was case sensitive. Thanks, I'll give it a shot
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 04 Jul 2016 07:36 PM |
"leaderstays". just noticed. heh.
|
|
|
| Report Abuse |
|
|