Last active
April 18, 2026 21:12
-
-
Save adudu21isme/430cb23b7db04065a219df8feddd7efd to your computer and use it in GitHub Desktop.
This is via force deleting them from the game, if most of the playerbase is from the county then i assume dont use this since it will prevent all players from such county from joining. for https://x.com/peek_ui/status/2045061741357203644
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --[[ | |
| Important note! | |
| This is via force preventing them from playing via a Script, you can block the region/county in the roblox dashboard too! | |
| https://create.roblox.com/dashboard/creations/experiences/REPLACEWITHUNIVERSEID/access | |
| https://x.com/realAdudu21/status/2045610843023245662 | |
| ]] | |
| --// Services - yes this is human made obviously, i format stuff like this n yk | |
| local LocalizationService = game:GetService("LocalizationService") | |
| local Players = game:GetService("Players") | |
| -- Listen for new players joining game | |
| local function PlayerAdded(Player: Player) | |
| --[[ | |
| Incase if this somehow fails, dont be fatal, if you want a strict version where no matter what the player in such county | |
| isnt allowed to play no matter what let me know and i will make it. | |
| ]] | |
| local Success, County = pcall(function() | |
| return LocalizationService:GetCountryRegionForPlayerAsync(Player) | |
| end) | |
| --// IL is Israel, https://create.roblox.com/docs/reference/engine/classes/LocalizationService#GetCountryRegionForPlayerAsync | |
| if Success and County=="IL" then | |
| --// Kick from game | |
| Player:Kick("You are not allowed.") | |
| --// Ensure no bypasses | |
| return Player:Destroy() | |
| end | |
| end | |
| --// For new players | |
| Players.PlayerAdded:Connect(PlayerAdded) | |
| --// For all current players | |
| for _,v in Players:GetPlayers() do | |
| task.spawn(PlayerAdded,v) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment