|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 13 Sep 2016 12:09 PM |
| ######################################################################################################################################################################################################## |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 13 Sep 2016 12:55 PM |
| ############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################# |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2016 01:44 PM |
The problem is there are multiple gamepasses I want it to check for
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2016 01:45 PM |
| Then run the function multiple times |
|
|
| Report Abuse |
|
|
Skelris
|
  |
| Joined: 02 Jan 2009 |
| Total Posts: 4785 |
|
|
| 13 Sep 2016 01:50 PM |
| ######################################################################################################################################################################################################################### |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|