|
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.
|
|
|
|
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
--]]
|
|
|
######################################################################################################################################################################################################## |
|
h_qrJoin Date: 2012-07-04 Post Count: 231 |
local id = 00000 -- change lol
game.Players.PlayerAdded:connect(function(plr)
if game:GetService('GamePassService'):PlayerHasPass(plr,id) then
-- code
end
end)
|
|
|
############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################# |
|
|
The problem is there are multiple gamepasses I want it to check for
|
|
|
Then run the function multiple times |
|
ExtulsJoin Date: 2009-01-02 Post Count: 5557 |
######################################################################################################################################################################################################################### |
|
ExtulsJoin Date: 2009-01-02 Post Count: 5557 |
|
|
|
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. |
|
NartronicJoin Date: 2014-08-28 Post Count: 916 |
-- 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)
|
|