Thanks for looking at my question. I'll dive into it.
What I Want To Happen
When a Player clicks a Text Button, I want them to leave the game. I have the code that I think will work, but probably not.
local Button = script.Parent.Quit local HasPressed = false function HasPressedQuit() if HasPressed == false then game.Players.LocalPlayer.Parent = nil end
I Probably Know What Your Thinking...
This is wrong to the max, but if you guys could give me a link or something, that'll be great! Thanks!
GreekGodOfMLG
button.MouseButton1Click:connect(function() game.Players.LocalPlayer:Kick("Removed from server!") end)
Make sure it's a local script and that you have declared "button" as the textbutton :3
I remote-event is the best way using a fire-server command which instantly kicks a player, but requires scripting.
button.MouseButton1Click:connect(function(plr) plr:Kick("Player name") end)