i’m trying to make a banland thing, where if a player is banned by an admin, they will be sent to a separate place each time they join, but i can’t figure out how to do it
1 Like
Its kind of simple. You can store data that this player is banned. If they are banned then teleport them to banland
- Step 1: Create a DataStore script (there are some great tools for that like Suphi’s DataStore Module)
- Step 2: Kick the player and use the Teleport Service to teleport the player to the banland
-- game.ServerScriptService
local teleportService = game:GetService("TeleportService")
local players = game:GetService("Players")
local banlandId = 0
players.PlayerAdded:Connect(function(player)
local data -- Get player Data
local isBanned = data["Banned"] == true
if isBanned then
player:Kick("Awaiting Teleport...") -- make sure to kick since exploiters can prevent this by teleporting to closed experiences
teleportService:Teleport(banlandId, player)
-- I'm unsure if you have to kick or TP first, please test that
return -- return early unless you want to do something after
end
end)
Or, you could use the Messaging Service although new servers won’t ban the player.