local player = game.Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local screenGui = Instance.new("ScreenGui") screenGui.Parent = playerGui screenGui.ResetOnSpawn = false local button = Instance.new("TextButton") button.Parent = screenGui button.Text = "Kick" button.Size = UDim2.new(0, 100, 0, 50) button.Position = UDim2.new(0.5, -50, 0.5, -25) button.BackgroundColor3 = Color3.fromRGB(255, 0, 0) button.TextColor3 = Color3.fromRGB(255, 255, 255) local dragging = false local dragStart = nil local startPos = nil button.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = button.Position end end) button.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart button.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) button.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) button.MouseButton1Click:Connect(function() player:Kick("You were kicked from the game by clicking on the button") end)