Advertisement
spicychilly2_RBX

My admin script for roblox dev server

Jul 17th, 2019
974
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. -- Admin script made by spicychilly2
  2. -- when this script is ran everyone who joins will get admin
  3.  
  4. -- use commands: !speed (amount) and !reset and !kickmyself
  5.  
  6. local prefix = "!" -- this is the prefix
  7.  
  8. game.Players.PlayerAdded:Connect(function(plr) -- Fires when someone joins the game
  9.     plr.Chatted:connect(function(msg) -- Fires if player that joined has chatted
  10.         if string.match(msg, prefix) then -- if player's message has the prefix in it this will fire
  11.             if string.match(msg, prefix.."speed") then  -- fires if player is trying to do the !speed command
  12.                 local amount = tonumber(msg:sub(string.len(prefix.."speed") + 2)) -- gets the amount of speed that hat player added in the command
  13.                 plr.Character.Humanoid.WalkSpeed = amount -- setting player's walkspeed to the amount they chose
  14.                 print("Set "..plr.Name.."'s speed to "..amount..".")
  15.             end
  16.            
  17.             if string.match(msg, prefix.."reset") then
  18.                 plr.Character.Humanoid.Health = 0
  19.             end
  20.            
  21.             if string.match(msg, prefix.."kickmyself") then
  22.                 plr:Kick("You kicked yurself!")
  23.             end
  24.         end
  25.     end)
  26. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement