How to Kick Players by Pressing a Button
Download – Button Model & Script
How To – Kick Players by Pressing a Button in Roblox Studio
What’s up everyone welcome to buzzygames, my name is BuzzyGamesBeth and today I’ll be teaching you how to kick players by pressing a button!
- We’re going to make a part where anytime they interact with a part (or anything), they will get kicked from the game.
- I’m going to add a proximity prompt and a script. Let’s go ahead and focus on the proximity prompt first. Inside of our properties, let’s change your action text to anything you want. This text is going to display anytime they’re near the part. I’m going to change the whole duration (how long people should hold the key for the action to occur) and then the key code which is just the same.
- Inside of our script, we have our variable which references our part and another variable referencing our proximity prompt. We have a function where any time a player triggers that proximity prompt, then the player will be kicked out of the game.
- I’ll have a little print statement here where it’s like got ’em! anytime they get kicked. If we hop into our game and hit the part, you’ll see the player get kicked from the server.