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 » Scripters
Home Search
 

Re: Gamepass instead of shirt

Previous Thread :: Next Thread 
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
13 Sep 2016 10:35 AM
Hi! I need to update this so it checks for the gamepass specified instead of a shirt.

function check_if_got_shirt(plr,srtid)
return game:GetService("BadgeService"):UserHasBadge(plr.userId, srtid)
end

I have the ids set to values like gamepass1_id so I need it to check for whatever gamepass id has been specified.


Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
13 Sep 2016 10:38 AM
http://wiki.roblox.com/index.php?title=Game_pass#Giving_the_Game_Pass_an_effect

That should help you.
Report Abuse
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
13 Sep 2016 10:54 AM
I forgot to add this part too.

--[[
function onPlayerEntered(newPlayer)
wait(1)
if (newPlayer == nil) then return end

char = newPlayer.Character
while char:findFirstChild("Torso") == nil do
wait()
end
wait(1)
if char:findFirstChild("Shirt Graphic") ~= nil then
decal = char:findFirstChild("Shirt Graphic").Graphic
else
decal = ""
end
buy(newPlayer,decal)
end
--]]


Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
13 Sep 2016 12:09 PM
########################################################################################################################################################################################################
Report Abuse
T_ry is not online. T_ry
Joined: 04 Jul 2012
Total Posts: 230
13 Sep 2016 12:45 PM

local id = 00000 -- change lol

game.Players.PlayerAdded:connect(function(plr)

if game:GetService('GamePassService'):PlayerHasPass(plr,id) then



-- code



end
end)


Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
13 Sep 2016 12:55 PM
#############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
Report Abuse
KaiVonZiegner is not online. KaiVonZiegner
Joined: 26 Jan 2013
Total Posts: 113
13 Sep 2016 01:44 PM
The problem is there are multiple gamepasses I want it to check for


Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
13 Sep 2016 01:45 PM
Then run the function multiple times
Report Abuse
Skelris is not online. Skelris
Joined: 02 Jan 2009
Total Posts: 4785
13 Sep 2016 01:50 PM
#########################################################################################################################################################################################################################
Report Abuse
Skelris is not online. Skelris
Joined: 02 Jan 2009
Total Posts: 4785
13 Sep 2016 01:50 PM
Omg I can't believe ROBLOX's filter. Okay okay. Pretty much what I said was:

Use this:
http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PlayerOwnsAsset

NOT this:
http://wiki.roblox.com/index.php?title=API:Class/GamePassService/PlayerHasPass
Report Abuse
SimplyRemove is not online. SimplyRemove
Joined: 24 Nov 2012
Total Posts: 4387
13 Sep 2016 01:54 PM
Yeah, what @Skelris said. Using MarketplaceService means that people don't need to rejoin the game into a different server for a gamepass to take effect.
Report Abuse
Nartronic is not online. Nartronic
Joined: 28 Aug 2014
Total Posts: 916
13 Sep 2016 02:11 PM
-- MARKETPLACE SERVICE
local MarketplaceService = game:GetService("MarketplaceService")

-- GAMEPASSES
local Gamepass1 = 000000000
local Gamepass2 = 000000000
local Gamepass3 = 000000000

-- CHECK IF THEY HAVE THE GAMEPASSES
game.Players.PlayerAdded:connect(function(Player)
if MarketplaceService:PlayerOwnsAsset(Player, Gamepass1) then
-- Do something here.
end
if MarketplaceService:PlayerOwnsAsset(Player, Gamepass2) then
-- Do something here.
end
if MarketplaceService:PlayerOwnsAsset(Player, Gamepass3) then
-- Do something here.
end
end)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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