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 » Scripting Helpers
Home Search
 

Re: Game Pass Help

Previous Thread :: Next Thread 
DracoTheSecond is not online. DracoTheSecond
Joined: 07 Nov 2011
Total Posts: 859
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
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
27 Jan 2013 10:50 AM
No one is going to make the entire script.
Report Abuse
DracoTheSecond is not online. DracoTheSecond
Joined: 07 Nov 2011
Total Posts: 859
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 is not online. 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
DracoTheSecond is not online. DracoTheSecond
Joined: 07 Nov 2011
Total Posts: 859
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 is not online. Combrad
Joined: 18 Jul 2009
Total Posts: 11025
27 Jan 2013 11:02 AM
L = Level*25
Report Abuse
DracoTheSecond is not online. DracoTheSecond
Joined: 07 Nov 2011
Total Posts: 859
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
DracoTheSecond is not online. DracoTheSecond
Joined: 07 Nov 2011
Total Posts: 859
28 Jan 2013 01:30 AM
...
Report Abuse
Combrad is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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