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: Script help with gamepasses.

Previous Thread :: Next Thread 
LordSulfix is not online. LordSulfix
Joined: 11 Aug 2013
Total Posts: 79
10 Aug 2014 04:21 PM
local version = 1.1
print("EncodedLua's GamePass Perks Script " .. version .. " loaded!")

local gamepasses = {
[171096080] = {--Health +50
["FireOnPlayerDeath"] = false, -- Will ["Action"] run when the player dies?
["Action"] = function(player)
-- Action that fires if the joining player has the pass with the id of passId
player.Character.Humanoid.MaxHealth=player.Character.Humanoid.MaxHealth+50
player.Character.Humanoid.Health=player.Character.Humanoid.MaxHealth
end,
},
}

game.Players.PlayerAdded:connect(function(player)
local GamePassService = game:GetService("GamePassService")

for i, v in pairs(gamepasses) do
if GamePassService:PlayerHasPass(player, i) then
v["Action"](player)
end
end

player.CharacterRemoving:connect(function()
player.CharacterAdded:connect(function(character)
for i, v in pairs(gamepasses) do
if GamePassService:PlayerHasPass(player, i) and v["FireOnPlayerDeath"] then
v["Action"](player)
end
end
end)
end)
end)

This wont work when you die your health goes back to normal.
Report Abuse
ehern11 is not online. ehern11
Joined: 23 Apr 2011
Total Posts: 1541
10 Aug 2014 04:31 PM
you didn't make this
Report Abuse
LordSulfix is not online. LordSulfix
Joined: 11 Aug 2013
Total Posts: 79
10 Aug 2014 04:37 PM
Your right, my Dev Team Partner did. EncodedLua
Report Abuse
EncodedLua is not online. EncodedLua
Joined: 02 May 2012
Total Posts: 1555
10 Aug 2014 04:38 PM
Support
Report Abuse
LordSulfix is not online. LordSulfix
Joined: 11 Aug 2013
Total Posts: 79
10 Aug 2014 04:43 PM
Yep.
Report Abuse
LordSulfix is not online. LordSulfix
Joined: 11 Aug 2013
Total Posts: 79
10 Aug 2014 04:48 PM
bump
Report Abuse
LordSulfix is not online. LordSulfix
Joined: 11 Aug 2013
Total Posts: 79
10 Aug 2014 05:22 PM
NVM Encoded figured it out :D
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