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
 

Extra Health Gamepass

Previous Thread :: Next Thread 
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
31 Mar 2014 08:55 PM
Id = "http://www.roblox.com/asset/?id="

function Respawn(p)
wait(5)
if p.Character.Torso.roblox.Texture == Id then
p.Character.Humanoid.MaxHealth = p.Character.Humanoid.MaxHealth + 10000
p.Character.Humanoid.Health = p.Character.Humanoid.Health + 10000

end
end
function onPlayerAdded(p)
p.Changed:connect(function(property)
if property == "Character" then
Respawn(p)
end
end)
end

game.Players.ChildAdded:connect(onPlayerAdded)




^Theres the script
I need help making it so changing the ID will work for gamepasses, because at the moment it only works for t-shirts.
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
01 Apr 2014 03:30 PM
bump
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
01 Apr 2014 03:33 PM
You're using a T-Shirt instead of a gamepass

passid = 0 -- gamepass ID
h = 500 -- The health you get with the gamepass

game.Players.PlayerAdded:connect(function(p)
if game:GetService("GamePassService"):PlayerHasPass(passid,p) then
p.CharacterAdded:connect(function(c)
c.Humanoid.MaxHealth = h
c.Humanoid.Health = c.Humanoid.MaxHealth
end)
end
end)

Follow me on twitter: @Jonibus_RBX
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
01 Apr 2014 03:35 PM
local id = --PassIDHere(Last about 6 numbers of the URL)

game.Players.PlayerAdded:connect(function(plr)
plr:WaitForDataReady()
if Game:GetService("GamePassService"):PlayerHasPass(plr, id) then
plr.CharacterAdded:connect(function(char)
wait(5)
p.Character.Humanoid.MaxHealth = p.Character.Humanoid.MaxHealth + 10000
p.Character.Humanoid.Health = p.Character.Humanoid.Health + 10000
end)end end)
Report Abuse
Scriptury is not online. Scriptury
Joined: 21 Aug 2013
Total Posts: 220
01 Apr 2014 03:36 PM
You might want to add a WaitForChild to Jonibus' script as it takes time for a humanoid to replicate which is dangerous considering the speed of CharacterAdded.
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
01 Apr 2014 03:39 PM
passid = 0 -- gamepass ID
h = 500 -- The health you get with the gamepass

game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
if game:GetService("GamePassService"):PlayerHasPass(passid,p) then
p.CharacterAdded:connect(function(c)
repeat wait() until c:findFirstChild("Humanoid")
c.Humanoid.MaxHealth = h
c.Humanoid.Health = c.Humanoid.MaxHealth
end)
end
end)

Improved it.

Follow me on twitter: @Jonibus_RBX
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
01 Apr 2014 05:13 PM
@jon I need it to ADD to health, not equal it.
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
01 Apr 2014 07:54 PM
It's a very easy fix to change it to how you want.

Follow me on twitter: @Jonibus_RBX
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
01 Apr 2014 08:01 PM
Did mine not work?
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
01 Apr 2014 08:46 PM
No goul, i tried
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
01 Apr 2014 08:46 PM
passid = 0 -- gamepass ID
h = 500 -- The health you add

game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
if game:GetService("GamePassService"):PlayerHasPass(passid,p) then
p.CharacterAdded:connect(function(c)
repeat wait() until c:findFirstChild("Humanoid")
c.Humanoid.MaxHealth = c.Humanoid.MaxHealth + h
c.Humanoid.Health = c.Humanoid.MaxHealth
end)
end
end)

Follow me on twitter: @Jonibus_RBX
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
01 Apr 2014 08:47 PM
Thanks! :D
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
01 Apr 2014 09:02 PM
Doesnt seem to be working...
I put in my own game pass, and it didnt work, then I tried the test gamepass, and it didnt work either.
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
02 Apr 2014 08:26 PM
bump
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
03 Apr 2014 07:54 PM
bump2
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
04 Apr 2014 10:05 AM
bump3...
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
04 Apr 2014 11:37 AM
ID =


game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
repeat wait() until c
if game:GetService("GamePassService"):PlayerHasPass(p,ID) then
c.Humanoid.MaxHealth = c.Humanoid.MaxHealth + 10000
wait(.3)
c.Humanoid.Health = c.Humanoid.Health + 10000
end)
end)


~Hyroad~
Report Abuse
DrChowderr is not online. DrChowderr
Joined: 24 Oct 2009
Total Posts: 5685
05 Apr 2014 03:50 PM
Doesnt seem to be working? >_>
Report Abuse
Jonibus is not online. Jonibus
Joined: 30 Jan 2010
Total Posts: 8985
05 Apr 2014 05:16 PM
passid = 0 -- gamepass ID
h = 500 -- The health you add

game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
if game:GetService("GamePassService"):PlayerHasPass(p,passid) then
p.CharacterAdded:connect(function(c)
repeat wait() until c:findFirstChild("Humanoid")
c.Humanoid.MaxHealth = c.Humanoid.MaxHealth + h
c.Humanoid.Health = c.Humanoid.MaxHealth
end)
end
end)

Follow me on twitter: @Jonibus_RBX
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