local input = game.StarterGui.ScreenGui.Frame.TextBox.Text
game.Players.PlayerAdded:connect(function(plr)
if input == plr.Name then
input:Kick()
end
end)
This script does not work, why?
Ok, so you are trying to kick a string or a text. That's like doing "roblox":Kick(), That won't work since Kick()
requires a player instance to function. And what if the textboxe's text wasn't exactly the players name? We could lower case all all of the string's text and the player's name to see if it matches.
local input = Textbox.Text game:GetService("Players").PlayerAdded:Connect(function(player) if string.lower(input) == string.lower(player.Name) then player:Kick("You have been kicked by some random person lmao") end end)
You have to put the local script in a screenGui that has the Frame or TextBox. Then instead of game.StarterGui.ScreenGui.TextBox.Text, do
local input = script.Parent.TextBox.Text
-- Do the function Next --