How to make your own admin commands?

How to make your own admin commands?
I want to make my own but don’t know how.
Some one please help?

Use a server script and game.Players#Player.Chatted event
and parse the string

1 Like

@Alvin_Blox Made this tutorial a little bit back, its long but its helpful.

1 Like

Please do some research before making this topic. The above person has a video suggestion already.

That is inefficient, because your gonna have to copy the same events or statements again and again if you were to make more commands. Consider using a table instead.

I was not referring to it in that way

This is Not my Script but it Works Perfectly well


local function get_best_target(target_name)
  for _, player in pairs(game.Players:GetPlayers()) do
    if (player.Name:lower():find(target_name) == 1) then
      print('Best fit player was: ', player.Name)
      return player
    end
  end		
end

game.Players.PlayerAdded:Connect(function(Player)
  if Player.Name == "ItzMeZeus_IGotHacked" then
    Player.Chatted:Connect(function(msg)
      msg = msg:lower()
      local cmd = '/tp'
      if msg:sub(1, #cmd) == cmd then
        local plr_name = msg:sub(#cmd+1, #msg)
	local target = get_best_target(plr_name)
	if target then
	 Player.Character.HumanoidRootPart.Position = target.Character.HumanoidRootPart.Position
	end
      end
    end)
  end
end)

I wouldnt recommend using player.Name as you might gonna change your name,so use UserId instead

1 Like

I agree with this statement, And it also Protects from Hackers

ye thank for helpinhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh