Title says most of it, if a player has a gamepass how would I put it into a table?
Sorry there's not much code but not sure what to do..
Table:
1 | VIPs = { } |
In the end I hope to do this:
1 | function CheckVIPs(name) |
2 | for i = 1 , #VIPs do |
3 | if VIPs [ i ] = = name then |
4 | return true ; |
5 | end |
6 | end |
7 | return false ; |
8 | end |
You need to use market place service, for this script it is very simple, basically like admin.
01 | local VIPs = { } |
02 |
03 | local passId = 0000000 -- change this to your game pass ID. |
04 |
05 | function isAuthenticated(player) -- checks to see if the player owns your pass |
06 | return game:GetService( "MarketplaceService" ):PlayerOwnsAsset(player, passId) |
07 | end |
08 |
09 | game.Players.PlayerAdded:connect( function (plr) |
10 | if isAuthenticated(plr) then |
11 | table.insert(VIPs, plr) |
12 | end |
13 | end ) |
If you need any more help, go to this wiki page: