Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can i create kick system by clicking on a player?

--This is a local script inside starter Gui and i am trying to make it so when i "target"player it will kick him but i am the one getting kicked + i cannot use click detector inside the player
wait(3)

local tool = Instance.new("Tool")

local players = game:GetService("Players")

tool.Parent = game.Players.LocalPlayer.Backpack

local mouse = game.Players.LocalPlayer:GetMouse()

tool.RequiresHandle = false

  

tool.Activated:Connect(function()

local hit = mouse.Target

local character = hit.Parent

if mouse.Target and mouse.Target.Parent then

local player = players:FindFirstChildOfClass("Player",character)

player:Kick("You've been kicked")

end

end)

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.