local button = script.Parent button.Activated:Connect(function() game.Players.LocalPlayer:Kick("Cancled")
Alright. Let's assume that there is a button inside a ScreenGui inside the StarterGui. Inside the button is a LocalScript. This is the LocalScript's code:
local player = game.Players.LocalPlayer local button = script.Parent button.MouseButton1Click:Connect(function() player:Kick('reason') end)
Hope this helped!
umm game:Destroy()??
You should kick the player, not delete the game.
game.Players.LocalPlayer:Kick("Reason")
edit:
what is ".clicked" by the way? here fixed script:
local button = --You're button button.Activated:Connect(function() game.Players.LocalPlayer:Kick("Reason")
Hey, if you want to kick the person who clicked only, then you can use a local script and insert :
local button = game.StarterGui.ScreenGui.Button -- or wherever your button location is button.MouseButton1Down:Connect(function() game.Players.LocalPlayer:Kick("Reason") end)