Here's some code.
local player = script.Parent.Parent.Player local reason = script.Parent.Parent.Reason script.Parent.MouseButton1Click:Connect(function() local player = game.Players local kick = player:FindFirstChild(player.Text) kick:Kick(reason.Text) end)
It wont kick the player!!
This is my personal kick script for an Admin GUI i made a while back.
function kick() if script.Parent.Parent.Kick.Text == "" then else usertokick = script.Parent.Parent.WhoToKick.Text ready = game.Players:FindFirstChild(usertokick):Kick('You have been kicked from this game:'.. script.Parent.Parent.Reason.Text) print (usertokick .. " has been kicked") wait(2) end end script.Parent.MouseButton1Click:connect(kick)
edit it to your liking if you wish.
Also it is a script, not LocalScript
Please read the whole thing.
all times I say lines is in your script
at line 7 it's player:Kick()
and you cant say local player =
twice it makes it invalid
Belows script does not work:
local player = game.Players.LocalPlayer local reason = script.Parent.Parent.Reason script.Parent.MouseButton1Click:Connect(function() player:Kick(reason.Text) end)
see this for more help.
also what Elixcore said: "The other problem is that it's a Script inside a PlayerGui."