|
| 27 Jan 2013 10:47 AM |
I'm trying to make a game pass for +1000 Max Health. It's for an RPG so at the minute the health is like this:
S = Usual health (100) A = Armour Bonus L = Level Bonus GP = Game Pass (+ 1000 Health)
S + A + L
I need it too look like this:
S + GP + A + L
I've tried some scripts but they don't seem to work... I need some help... |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2013 10:50 AM |
| No one is going to make the entire script. |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2013 10:55 AM |
Here is the script I have but instead of health = 150 I need it too be health = +150 but when I try too do that, it won't work at all
gpid = "000000" --ID Goes here health = 150
GPS = Game:GetService("GamePassService") function respawned(char) player = game.Players:FindFirstChild(char.Name) print("Respawned") if char:FindFirstChild("Head") ~= nil then print("It's a Player!") if GPS:PlayerHasPass(player, gpid) then print("Has GPID") char.Humanoid.MaxHealth = health char.Humanoid.Health = health else print("No GPID") end end end game.Workspace.ChildAdded:connect(respawned)
|
|
|
| Report Abuse |
|
|
Combrad
|
  |
| Joined: 18 Jul 2009 |
| Total Posts: 11025 |
|
|
| 27 Jan 2013 10:57 AM |
If I am not wrong
S = 100 A = 0 L = 0 GP = GPS:PlayerHasPass(player, gpid) and 1000 or 0 |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2013 11:01 AM |
| So I start with 100 health, I get 25 for each level... let's say I'm level 10. Now I have 350 health. I get a +100 health armour, I'm up to 450. Now I go and buy the game pass, and I have 1450... But that doesn't work. The script I'm using ignores your level bonus... |
|
|
| Report Abuse |
|
|
Combrad
|
  |
| Joined: 18 Jul 2009 |
| Total Posts: 11025 |
|
| |
|
|
| 27 Jan 2013 11:03 AM |
| Yes... that's not it though... I need the script fixing so that it adds health and not sets the health |
|
|
| Report Abuse |
|
|
| |
|
Combrad
|
  |
| Joined: 18 Jul 2009 |
| Total Posts: 11025 |
|
|
| 28 Jan 2013 01:36 AM |
BaseHealth = 100 --Starting Health Level = 10 Bonus = 0 GP = GPS:PlayerHasPass(player, gpid) and 1000 or 0
function UpdateHealth() --Fire this when you want the health updated local pH = player.Character.Humanoid.Health/player.Character.Humanoid.MaxHealth player.Character.Humanoid.MaxHealth = BaseHealth+(Level*25)+Bonus+GP player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth*pH end |
|
|
| Report Abuse |
|
|