So Im trying to make a command where if a developer chats "/kick (players name)" it kicks them, but i'm super confused on how to reference the player. Any help?
game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) if msg == "/kick"..game.Players:GetPlayers().Name then game.Players:GetPlayers().Name:Kick() end end) end)
I figured it out lol.
game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) if string.sub(msg,1,5) == "/kick" and plr:FindFirstChild("DEVELOPER") ~= nil then local player = game.Players:FindFirstChild(string.sub(msg,7)) if player then player:Kick() end end end) end)