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
 

Is there a way to check if a player DOESN'T have a gamepass?

Previous Thread :: Next Thread 
Alexrocksdude is not online. Alexrocksdude
Joined: 19 Jan 2011
Total Posts: 3828
28 Dec 2012 01:45 PM
^^^

Perfection is not attainable, but if we chase perfection we can catch excellence.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
28 Dec 2012 01:46 PM
if not GAMEPASSSERVICE:PlayerHasPass(PLAYER, PASSID) then
-- stuff
end
Report Abuse
Alexrocksdude is not online. Alexrocksdude
Joined: 19 Jan 2011
Total Posts: 3828
28 Dec 2012 01:49 PM
So this should work?

local GamePassId = 101708765

function onPlayerEntered(player)
    local stats = Instance.new("IntValue")
    stats.Name = "leaderstats"
    local c = Instance.new("IntValue")
    c.Name = "Points"
    c.Value = 0
    c.Parent = stats
    stats.Parent = player
    player:WaitForDataReady()
    c.Value = player:LoadNumber("Points")
if (Game:GetService("GamePassService"):PlayerHasPass(player,GamePassId)) and
    if c.Value ​>= 1000 then
        c.Value = 1000
end end
if not(Game:GetService("GamePassService"):PlayerHasPass(player,GamePassId)) and
 if c.Value ​>=500 then
c.Value = 500
end end

Perfection is not attainable, but if we chase perfection we can catch excellence.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
28 Dec 2012 01:53 PM
if (Game:GetService("GamePassService"):PlayerHasPass(player,GamePassId)) and
c.Value ​>= 1000 then
c.Value = 1000
end


if not(Game:GetService("GamePassService"):PlayerHasPass(player,GamePassId)) and
c.Value ​>=500 then
c.Value = 500
end
Report Abuse
Alexrocksdude is not online. Alexrocksdude
Joined: 19 Jan 2011
Total Posts: 3828
28 Dec 2012 02:26 PM
THANK YOU SOOOOOOO MUCH.

Perfection is not attainable, but if we chase perfection we can catch excellence.
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