i want the door to open to these people OR if they own the gamepass (id: 285082790)
01 | local allow = ( |
02 | player.Name = = "SimplyKol" or |
03 | player.Name = = "play1885" or |
04 | player.Name = = "Nick7cool" or |
05 | player.Name = = "DarwinYork" or |
06 | player:IsInGroup( 1107429 ) or |
07 | game:GetService( 'GamePassService' ):UserHasGamePass(player.userId, 285082790 ) or |
08 | game.CreatorId = = player.userId |
09 | ) |
10 | if allow then |
11 | open() |
12 | delay( 4.5 , close) |
13 | end |
14 | end ) |
more specifically
1 | game:GetService( 'GamePassService' ):UserHasGamePass(player.userId, 285082790 ) |
if it isn't correct then what is? im not getting an error but i still dont know if it works.
This is actually pretty neat. Though I would create a function and a table to make things a little bit faster and easier to code:
01 | AllowedPlayers = { "SimplyKol" , "play1885" , "Nick7cool" , "DarwinYork" } |
02 |
03 | function CorrectPlayer(player) |
04 | for i,v in pairs (AllowedPlayers) do |
05 | if player.Name = = v then |
06 | return true |
07 | end |
08 | end |
09 | return false |
10 | end |
11 |
12 | if CorrectPlayer(player) or game:GetService( 'TShirtService' ):UserHasTShirt(player.userId, 283727664 ) or game.CreatorId = = player.userId then |
13 | open() |
14 | delay( 4.5 , close) |
15 | end |
16 | end ) |
This will do the same thing as your code but it simplifies the player names you want so it is easier to add or remove names without having to write "if player.Name=="x" or player.Name=="y" or player.Name=="z" or..."