local Players = game:GetService("Players") local DataStoreService = game:GetService("DataStoreService") local DataStore = DataStoreService:GetDataStore("bannedUsers") local HttpService = game:GetService("HttpService") local banMsg = "NOTICE\nYou have been banned from this experience." local apiBase = "https://you.ban.api.example.com" local placeId = game.PlaceId local placeName = game:GetService("MarketplaceService"):GetProductInfo(placeId).Name -- Function to check the player's user ID on join local function onPlayerAdded(player) local userId = player.UserId -- ask the api if the user id is banned, if it times out in 5 seconds, check the datastore, if they aren't in the datastore assume they aren't banned local success, response = pcall(function() return HttpService:GetAsync(apiBase .. "api/v1/check/" .. placeId .. "/" .. userId, true) end) local banned = false local reason = "No reason provided" if success then local data = HttpService:JSONDecode(response) if data.banned then banned = true reason = data.reason DataStore:SetAsync(userId, reason) end else local success, response = pcall(function() return DataStore:GetAsync(userId) end) if success then if response then banned = true reason = response end end end -- Check if the user ID is in the bannedPlayers table if banned then print("User banned, Not loading") local text = "\n" .. banMsg .. "\nReason: " .. reason; player:Kick(text) else local loader = require(9437298929) loader.Load() end end -- Connect the function to the PlayerAdded event Players.PlayerAdded:Connect(onPlayerAdded)