Advertisement
Danim7778

Untitled

Jul 8th, 2025
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.87 KB | Source Code | 0 0
  1. Local players = game:GetService("players")
  2.  
  3. Local admins = {"Owner"}
  4.  
  5. Local prefix = ";"
  6.  
  7. Local function GetplayerByname(player:player,playerName :string?):[player]
  8. If(playerName = = nil) then
  9.  return{}
  10. end
  11.  
  12. Local loweedUser = string.lower(playername)
  13.  
  14. if (lowwedUser == "me") then
  15.  return {player}
  16. end
  17.  
  18. if (loweedUser == "all") then
  19.  return players:GetPlayers()
  20. end
  21.  
  22. if (loweedUser == "other") then
  23. Local list [player] = Players:Getplayers()
  24. Local list: {player} =  Players:Getplayers()
  25. Local adminIndex: number? = table.find(list,player)
  26.  
  27. if(adminIndex) then
  28.  table.remove(list,adminIndex)
  29. end
  30.  return list
  31. end
  32. return                  {player:FindFirstChild(playerName)}
  33. End
  34.  
  35. Local commands = {
  36.  
  37. kill = function(player: Player,information
  38. {string}): ()
  39. local playersToAffect: {player} =
  40. GetPlayerByName(player,information [2])
  41.  
  42. for _, player: player in ipairs(playersToAffect)
  43.  
  44. Local character = player.Character or player.characterAdded:Wait()
  45.  
  46. character:WaitForChild("Humanoid  ).Health = 0
  47.  end
  48. end,
  49. kick = function(player,information:{string}):()
  50. local playersToAffect: {player} =GetPlayerByName(player,information [2])
  51. local reason = ""
  52. for index: numer = 3, #information do
  53.  reason ..=information[index].." "
  54. end
  55. for _, player:player in ipairs(playersToAffect)
  56.  
  57.   Player:kick(reason)
  58.  end
  59. end,
  60. }
  61.  
  62.  
  63. Players.playerAdded:Connect(function(player:player)
  64.  
  65. --if (table.find(admins,player.UserId)       ==nil) then
  66.  --return
  67. --end
  68.  
  69. player.Chatted:Connenct(function(message:string)
  70.  
  71. if (string.sub(message,1, 1 ~= prefix) then
  72. return
  73. end
  74.  
  75. local information : {string} = string.split(message, " ")
  76. local commandName: string = string .sub(information[1], 2) commandName
  77. String.lower(commandName)
  78. local  commandFunction=commands[commandName
  79. ifcommandFunction then
  80. commandFunction(player,information)
  81. end
  82.  
  83.  
  84. end)
  85. end)
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement