Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
5

Is there a way to make a Script that Bans users by using UserID?

Asked by 9 years ago

Sorry for the unusual question and this is not a request . I looked through the Wiki and couldn't find anything relevant to what I was thinking about. So I was wondering If it is possible to create and script and ban someone using UserID?

2 answers

Log in to vote
1
Answered by 9 years ago

Probably yeah, I know that Kohls Admin Epix Edit shows everyone the players id and age, so I'm thinking if you tracked when the player joins the game if his userid is a certain one then make sure he cannot join.

0
Don't worry I found it using Object browser but if any of you guys want know this to Here. UserOnly20Characters 890 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

This is script that Bans users by UserName or UserId. I recently didn't know how to do this so I am posting the Script below so if any wants to know how to do it they can find it out.

Banned = {46678737,6678737,"ROBLOX" , "Builderman",} --This is the Table where you enter the person's **UserName**  or  **UserId** to Ban them!

game.Players.PlayerAdded:connect(function(player)--This function activate the script every time someone enters the game
for i,Player in pairs (Banned) do --This check the table 
    if player.userId == Player  or player.Name == Player then --This Check the person **username** or **userId** who entered the game is the same as the one in the table.
        player:Kick()--If the Players name or UserId is the same as the one in the table then it kicks the player of the game.
        end
    end 
end)

Answer this question