I am trying to make a script for a text button in a GUI that when pressed will kick the player from the game, this is what I have but it's not working.
local localplayer = game.Players.LocalPlayer
script.Parent.TextButton.MouseButton1Click:Connect(function(plr)
plr:Kick(localplayer)
end)
