What I mean by this is how could I create a script that uses strings to identify certain players/usernames and teleport them to a game ID of my choice, kind of like the banland script BIG studios put into their "BIG Paintball" Game.
This is quite simple.
All you need to do is create a server script
in ServerScriptService
then input this code:
Player's Username Script
local placeid = 00000000000 -- The Banland Place ID local tps = game:GetService("TeleportService") -- Gets TP Service local banned = { -- Banned Users "User1", "User2", "User3", "User4" } game.Players.PlayerAdded:Connect(function(player) -- If A Player Joins Runs The Code if table.find(banned,player.Name) then -- Checks if Player On List Is Equal To The Player's Username tps:Teleport(placeid,player) -- Teleports The User To Banland end end)
Note: THE ABOVE IS USING PLAYER'S USERNAMES. USE THE SCRIPT BELOW FOR PLAYER IDs!
Player's User ID
local placeid = 00000000000 -- The Banland Place ID local tps = game:GetService("TeleportService") -- Gets TP Service local banned = { -- Banned User's ID 00000000000, 00000000000, 00000000000, 00000000000 } game.Players.PlayerAdded:Connect(function(player) -- If A Player Joins Runs The Code if table.find(banned,player.UserId) then -- Checks if Player On List Is Equal To The Player's ID tps:Teleport(placeid,player) -- Teleports The User To Banland end end)
If you have any questions. just contact me!
I'd like to see your attempt next time.
local TeleportService = game:GetService("TeleportService") local Players = game:GetService("Players") local UserIdList = { 905646521, --[[ Your Id ]] 74087102 --// Mine } local TeleportPlaceId = --// Place Id Players.PlayerAdded:Connect(function(Player) if (UserIdList[Player.UserId]) then TeleportService:Teleport(TeleportPlaceId, Player) end end)
Closed as Not Constructive by Ziffixture
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?