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

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…

Oh wow, look who’s back editing their post to make himself in the right!

1 Like

You aren’t allowed to enforce fake rules on DevForum. Just a heads up. :+1:

1 Like

Especially after someone mentions it lol. He edited it to make himself “right” just like when he edited in “Msg” to give himself solution

1 Like

Another Reason to do a Server-side ban is because of DATA PROTECTION.
Having it local sided means that if the exploiter gets a hold of the LocalScript contents (which they can do) will also be able to get the list of all banned individuals.

This is bad for privacy. In your case it’s only one guy and the community is already partly aware, but they can still access the ban list (which is bad regardless).

You literally edited someones post and gave yourself the solution, and you are here making up your own rules, ironic.

One last time, insert this script INTO server script service and it WILL work.

local Players = game:GetService("Players")

local BannedUsers =  {
	["APlayerYouWantBannedHere"] = "reason for ban",
	["Eddy0107"] = "Perm banned for destroying what took 5 hours!"
}
	


Players.PlayerAdded:Connect(function(player)
	for Username, Message in pairs(BannedUsers) do
		if player.Name == Username then
			player:Kick(Message)
		end
	end
end)
2 Likes

To make matters worse, the edit he did said I forgot something that he edited into his OG reply AFTER I replied

I will NOT copy this…

No…

People will be forcing me to make ServerScripts to LocalScripts…

On ScreenGui’s or anything like that…

Yeah I saw, thats pathetic to be honest.

1 Like

Nobody will be forcing you bro, whats happening???

He’s referring to a completely off-topic thing about ScreenGuis

Dude, you are delusional. No one is forcing you to do anything, they are giving you tips. You are marking posts that aren’t the original solution, as the solution. You are refusing to accept help on your topic. You are enforcing made up rules on DevForum. Disgusting behaviour. Don’t make another topic if you’re gonna act like this.

2 Likes

I believe the only way this person would be able to destroy your game is by having editing permissions. If my assumption is true, you can actually restore your game and revert it’s version…

Steps to restore game:

  1. Go to your game page (you can find it somewhere in https://www.roblox.com/develop)
  2. Click the settings icon and click “Configure Start Place”
    Image1

    image

    Image2

    image

  3. Click on Version History, you should see your versions there… Just start from the version with the highest number and count down until you find the right version.
    Image1

  4. Click the 3 dots. You can either download or revert the version (it’s your choice). For me, downloading it would be much easier because I can just replace the downloaded file with the next version if it isn’t the correct one.
    Image1

    image

  5. After reverting/downloading the version, open your game in studio (or the downloaded place file). If it’s the correct version, the you can click FILE > Publish to Roblox as > Your game. If not the correct version just go back 1 version in the Version History. If it’s the same every time, try going back 2 versions each time.
  6. Make sure to actually publish the changes to your game from Roblox Studio (if not it will only be saved to the place in studio, not the actual place)

Bro why did you put simple script in the title if you failed to make it on your own, then pathetically copy others and calling it your own script?

2 Likes

No one can force you to make a LocalScript into a Server Script.

What I’m telling you is that you are willingly allowing data that should be protected to be vulnerable. As someone who understands the Data Protection Act (UK) and similar acts required when handling and storing data, you would be in violation (should it be enforced by moderation teams) of this and be putting a risk on individuals.

As for why to do a server script:

  • Follows Data Protection Act (or regional equivalent).

  • Bans are faster as the server kicks the player the moment they’re connected, the client can’t generally do anything to bypass this.

  • It’s safer for your game and your community.

2 Likes