Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script by lnsertYourself
- local whitelist = {"alwaysbloo", "BmanPlays","Frrankos","omarzarur","todomo"}
- local VIPgamepassId = 8839590
- local closeAll = "!closeALL"
- local openAll = "!openALL"
- local openVip = "!openVIP"
- local closeAllMessage = "Sorry, the server is closed to all players."
- local noGamepassMessage = "You must own the VIP gamepass to enter the game at this time."
- --// DO NOT MODIFY BEYOND THIS POINT \\--
- local currentStatus = closeAll
- local commands = {closeAll, openAll, openVip}
- local marketplaceService = game:GetService("MarketplaceService")
- game.Players.PlayerAdded:Connect(function(player)
- if currentStatus == openAll then
- -- Allow everyone in
- elseif currentStatus == closeAll then
- -- Only allow whitelisted players
- if not table.find(whitelist, player.Name) then
- player:Kick(closeAllMessage)
- end
- elseif currentStatus == openVip then
- -- Only allow whitelisted players and VIP players
- if not table.find(whitelist, player.Name) then
- local success, result = pcall(function()
- return marketplaceService:UserOwnsGamePassAsync(player.UserId, VIPgamepassId)
- end)
- if success then
- if not result then
- -- User does not own gamepass
- player:Kick(noGamepassMessage)
- end
- else
- -- Async failed
- player:Kick("Player status retrieval failed. Please try again.")
- end
- end
- end
- if table.find(whitelist, player.Name) then
- -- Whitelisted player
- player.Chatted:Connect(function(message, recipient)
- local index = table.find(commands, message)
- if index then
- -- One of the Server Status Commands
- currentStatus = commands[index]
- end
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement