How can I make a script that kicks a player on key press?

Right, My bad, I just re-read the rules and guilds my bad. Sorry to the user!

Thats client sided, not sure if you can kick from the client…

Thats fine we all make mistakes!

You can. I just tested my script and is works fine.

I’m going to put together a file which you can tweak or import into your game. brb when Im done.
Edit: or not

oh wow roblox is so much more vulnerable than I thought
Edit: On second thought I’m wondering if you can kick other players. it may only work for the client…

Yep, only for the client. :smiley:

1 Like

Exploit clients finding a way around filtering enabled:
GOGOGO!!!

Imagine Synapse X users looking at this thread lol

LOL imagine they found that out XD

Synapse X is a script executor, not a script that makes you fly.

??? lol were saying like synapse x users will ry to run that script and fail lol

I don’t see the point of this when DarkDex exists and since its a local script it can be removed on the client using

game.Players.LocalPlayer.PlayerScripts.Script:remove()

You should use the UserInputService with .InputBegan, and then kick the LocalPlayer with game.Players.LocalPlayer:Kick(reasonString)

Then you shouldn’t even created this topic at the first place. Please start some basics first before you even ask.

local uis = game:GetService("UserInputService")
local isInChat = false
uis.TextBoxFocused:Connect(function()
    isInChat = true
end)
uis.TextBoxFocusEnded:Connect(function()
    isInChat = false
end)
game:GetService("UserInputService").InputBegan:Connect(function(inputObject)
    if inputObject.KeyCode == Enum.KeyCode.Z and isInChat == false then
        game.Players.LocalPlayer:Kick("Reason goes here!")
    end
end)

This also prevents them from getting kicked if they press the key while in a TextBox/Chat.

There is actually a much easier way to kick players when they press a button. Check ValentinRBX’s message. :slight_smile:

I think that this may be a bad idea just incase like someone accidentally presses the button

Nice script, however you forgot to put ) after function(inputObject.

1 Like

I’m not sure but does the second parameter of InputBegan / Ended count when using textbox?

1 Like