[SOLVED] Script kicking every player when it's only 1 player (SIMPLE SCRIPT ONLY)

You added one word, because when I gave my solution:

msg wasn’t there in your post. So I didn’t know what made the message.

local msg = "You have been permenantly banned for destroying the whole make that took over 5 freaking hours ! Now you won't get any chances to be here..."

I suggest you don’t kick him on the client, he may be able to delete the local script, instead use a server script in ServerScriptService

This should work…
(sorry for the weird indentation, idk what happened lol)


local Players = game:GetService("Players")

local BannedUsers = {"Eddy0107"}



Players.PlayerAdded:Connect(function(player)

if table.find(BannedUsers , player.Name) then
player:Kick("You have been permenantly banned for destroying the whole make that took over 5 freaking hours ! Now you won't get any chances to be here...")
end
end)

I removed him from editing when i was extremely pissed off to him…

They will be mad at me, so i have to listen to the community…

Exploiters can remove and mess with local scripts. Please do what @TheSpecialNone said. It’s much better and safer.

The community will be pissed off and suggest and force me to make the ServerScripts into LocalScripts.

Like to:

Like I said you edited the post. When I responded Msg wasn’t there

They are talking about ScreenGui’s bro… You should use the server when it comes to kicking players when they join. And dont use the word pissed a lot, your post may get flagged.

Didn’t worked…

This text will be blurred


It should work, this is how it should be setup.

You should give the original post, and replier credits for the solution. Of course you may feel free to customise it after, but it is just petty to mark your own posts as solutions unless you geniunely figured it out on your own.

I use:

bandicam 2022-08-08 21-28-02-920 (3)

ServerScript = People will be mad at me…

That’s a difference in context, you need to understand how and where server scripts and local scripts work…

People will be mad at you if you don’t know how to use either…

1 Like

Just do what they’re telling you, and all will be fine.

Ayo stop replying, it’s solved !

You’re replying too, also that’s not a rule. :rofl:

You would want to make this server side, as it could just be bypassed on the client.


local BannedUser = {"Eddy0107"}
game.Players.PlayerAdded:Connect(function(player)
    if table.find(BannedUser, player.Name) then
        player:Kick()
    end
end)

I think that should work, I haven’t checked this in studio so yea.

Also it would be better to use the players ID as opposed to the name.

Nobody will be mad at you, the post you sent above is a whole different context, in which they said you should use local scripts for screen gui’s. Here however, you should use a server script, as exploiters will be able to delete you local script

1 Like
Click on me please...

Don’t ever reply to this after this…