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

Hello guys, i found another issue, this this i just wanted to do to make a player but banned, the guy that make the WHOLE map destroyed…

I don’t wanna make the whole map alone…

LocalScript:

local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local msg = "You have been permanently banned for destroying the whole make that took over 5 freaking hours ! Now you won't get any chances to be here..."

if BannedUser then
	BannedUser = LocalPlayer:Kick(msg)
end

Bug of the issue (Disconnect(Kick):

bandicam 2022-08-08 21-06-21-923

Also, send me simple scripts…

Any help is appreciated…

If it’s solved, don’t reply, thank you, this is the only rule on this topic…

Unless, now it’s closed…

3 Likes

Oh i guess i found it:

local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local PlayerJoined = game.Players.PlayerAdded
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..."

if BannedUser then
	PlayerJoined:Connect(function()
		BannedUser = LocalPlayer:Kick(msg)
	end)
end

Nope…

1 Like

I believe you meant:

if table.find(BannedUser, LocalPlayer.Name) then
    table.insert(BannedUser, LocalPlayer.Name)
    LocalPlayer:Kick(msg)
end

@domboss37 Thanks, but unfortunately, i get the solution because you forgot to put msg into the LocalPlayer:Kick()

local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local PlayerJoined = game.Players.PlayerAdded
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..."

if table.find(BannedUser, LocalPlayer.Name) then
	table.insert(BannedUser, LocalPlayer.Name)
	LocalPlayer:Kick(msg) -- This is what you forgot...
end
1 Like

Ok… it’s still my script but ok… I guess. (Edited btw) Have a good day!

Yeah but it’s still a tiny different…

local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local PlayerJoined = game.Players.PlayerAdded
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..."

if table.find(BannedUser, LocalPlayer.Name) then
	table.insert(BannedUser, LocalPlayer.Name)
	LocalPlayer:Kick()
end

And:

local BannedUser = {"Eddy0107"}
local LocalPlayer = game.Players.LocalPlayer
local PlayerJoined = game.Players.PlayerAdded
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..."

if table.find(BannedUser, LocalPlayer.Name) then
	table.insert(BannedUser, LocalPlayer.Name)
	LocalPlayer:Kick(msg)
end

Is just a tiny different…

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