Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Kick on click with TextButtons?

KickButton.MouseButton1Click:connect(function()
	game.Players.PlayerAdded:Connect(function(player)
	for _, v in pairs(KickName) do
		if player.Name == v then
			player:kick(prefix..KickReason)
		end
		end
end)

I have a gui that has a username textbox, and a reason. When you type in, you should click on the "Kick" button, and then it should kick whoever you typed in that box. However, this is not working for me.

1 answer

✓ Accepted answer

That's not the whole script!

The biggest reason why thisn won't work is because you're trying to kick a player from the client, players can only get kicked if the server says so, so you'll have to add a remote event. Also it's :Kick and not :kick.

This discussion is preserved as it was. New answers, comments, and votes are closed.