Advertisement
albinio546

adminal adminm

Aug 15th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.99 KB | None | 0 0
  1. local Admins = {
  2. [""] = 5,
  3. ["albinio667"] = 5,
  4. ["Player"] = 5,
  5. }
  6.  
  7. --Admins are players who can use cmd's. Ranks between 1 and 5, 1 is lowest, 5 is highest.
  8. --It uses 1337 haxes.
  9.  
  10. local Banned = {
  11. ["Noobert"] = true,
  12. }
  13.  
  14. -- Banned is players who cannot play this game. It uses even more 1337 haxs.
  15.  
  16. local Prefix = ":" -- The prefix before cmd's.
  17.  
  18. --[[
  19.  
  20. Commands:
  21.  
  22. [Prefix]Kick name - kicks name. Req. rank: 4
  23. [Prefix]Kill name - kills name. Req. rank: 2
  24. [Prefix]Ban name - bans name. Req. rank: 5
  25. [Prefix]Tp name1 name2 - teleport's name1 to name2. Req. rank: 1
  26. [Prefix]Ws name 99 - Makes name's walkspeed 99. Req. rank: 1
  27. [Prefix]Gear name ID - gives name the gear with that id. Req. rank: 2
  28. [Prefix]Char name ID - Makes name's character that UserId's character. Req. rank: 2
  29. [Prefix]Respawn name - Respawn's name. Req. rank: 2
  30. [Prefix]Noob name - Make's name a noob. Req. rank: 1
  31.  
  32. Indexable items:
  33.  
  34. Me -- Returns you.
  35. All -- Returns all.
  36. Far -- Returns people who are far away.
  37. Close -- Returns people who are close to you.
  38. Noobs -- Returns noobs.
  39. Elders -- Returns elders.
  40. Guests -- Returns guests.
  41. Random -- Returns 1 random player.
  42. Names -- Returns that player, if it exists.
  43. Partial names -- Returns that player, if it exists.
  44.  
  45. --]]
  46.  
  47. -- ~~ DO NOT TOUCH BELOW THIS LINE ~~ --
  48.  
  49. local Players = game:GetService("Players")
  50.  
  51. local function SplitStr(InputString,Seperator)
  52. if Seperator == nil then
  53. Seperator = "%s"
  54. end
  55. local t={};local i=1
  56. for str in string.gmatch(InputString,"([^"..Seperator.."]+)") do
  57. t[i] = str
  58. i = i + 1
  59. end
  60. return t
  61. end
  62.  
  63. local function FindPlayer(Speaker,Var)
  64. local ReturnedPlayers = {}
  65. for _,v in ipairs(Players:GetPlayers()) do
  66. if v.Name:lower():sub(1,#Var) == Var:lower() then
  67. return{v}
  68. end
  69. end
  70. if Var:lower() == "me" then
  71. return {Speaker}
  72. elseif Var:lower() == "all" then
  73. for _,v in ipairs(Players:GetPlayers()) do
  74. table.insert(ReturnedPlayers,v)
  75. end
  76. elseif Var:lower() == "random" then
  77. table.insert(ReturnedPlayers,Players:GetPlayers()[math.random(1,#Players:GetPlayers())])
  78. elseif Var:lower() == "elders" then
  79. for _,v in ipairs(Players:GetPlayers()) do
  80. if v.AccountAge >= 80 then
  81. table.insert(ReturnedPlayers,v)
  82. end
  83. end
  84. elseif Var:lower() == "close" then
  85. for _,v in ipairs(Players:GetPlayers()) do
  86. if (v.Character.Torso.Position-Speaker.Character.Torso.Position).Magnitude < 30 and v.Name ~= Speaker.Name then
  87. table.insert(ReturnedPlayers,v)
  88. end
  89. end
  90. elseif Var:lower() == "far" then
  91. for _,v in ipairs(Players:GetPlayers()) do
  92. if (v.Character.Torso.Position-Speaker.Character.Torso.Position).Magnitude >= 80 and v.Name ~= Speaker.Name then
  93. table.insert(ReturnedPlayers,v)
  94. end
  95. end
  96. elseif Var:lower() == "noobs" then
  97. for _,v in ipairs(Players:GetPlayers()) do
  98. if v.AccountAge < 30 then
  99. table.insert(ReturnedPlayers,v)
  100. end
  101. end
  102. elseif Var:lower() == "others" then
  103. for _,v in ipairs(Players:GetPlayers()) do
  104. if v.Name ~= Speaker.Name then
  105. table.insert(ReturnedPlayers,v)
  106. end
  107. end
  108. elseif Var:lower() == "guests" then
  109. for _,v in ipairs(Players:GetPlayers()) do
  110. if v.Name:lower():match("guest "):lower() then
  111. table.insert(ReturnedPlayers,v)
  112. end
  113. end
  114. end
  115. return ReturnedPlayers
  116. end
  117.  
  118. local function ConnectAdminChat(User)
  119. User.Chatted:connect(function(Message)
  120. if string.sub(Message,1,#Prefix) == Prefix then
  121. if SplitStr(Message,"%s")[1]:lower() == Prefix.."kill" and Admins[User.Name] >= 2 then
  122. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  123. for _, v in ipairs(Players) do
  124. v.Character:BreakJoints()
  125. end
  126. elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."kick" and Admins[User.Name] >= 4 then
  127. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  128. for _, v in ipairs(Players) do
  129. v:Kick()
  130. end
  131. elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."ban" and Admins[User.Name] >= 5 then
  132. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  133. for _, v in ipairs(Players) do
  134. v:Kick()
  135. table.insert(Banned,v)
  136. end
  137. elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."tp" and Admins[User.Name] >= 1 then
  138. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  139. for i = 1,#Players do
  140. Players[i].Character.Torso.CFrame = FindPlayer(User,SplitStr(Message,"%s")[3])[1].Character.Torso.CFrame*CFrame.new(i*-3.5,0,0)
  141. end
  142. elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."noob" and Admins[User.Name] >= 1 then
  143. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  144. for i = 1,#Players do
  145. for _,v in ipairs(Players[i].Character:GetChildren()) do
  146. if v:IsA("BodyColors") or v:IsA("Shirt") or v:IsA("Pants") or v:IsA("Hat") then
  147. v:Destroy()
  148. end
  149. end
  150. Players[i].Character.Head.BrickColor = BrickColor.new("New Yeller")
  151. Players[i].Character.Torso.BrickColor = BrickColor.new("Deep blue")
  152. Players[i].Character["Left Leg"].BrickColor = BrickColor.new("Earth green")
  153. Players[i].Character["Right Leg"].BrickColor = BrickColor.new("Earth green")
  154. Players[i].Character["Right Arm"].BrickColor = BrickColor.new("New Yeller")
  155. Players[i].Character["Left Arm"].BrickColor = BrickColor.new("New Yeller")
  156. end
  157. elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."respawn" and Admins[User.Name] >= 2 then
  158. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  159. for i = 1,#Players do
  160. Players[i]:LoadCharacter()
  161. end
  162. elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."ws" and Admins[User.Name] >= 1 then
  163. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  164. for i = 1,#Players do
  165. Players[i].Character.Humanoid.WalkSpeed = SplitStr(Message,"%s")[3]
  166. end
  167. elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."char" and Admins[User.Name] >= 2 then
  168. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  169. for i = 1,#Players do
  170. Players[i].CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId="..tonumber(SplitStr(Message,"%s")[3]).."&placeId="..game.PlaceId
  171. Players[i]:LoadCharacter()
  172. end
  173. elseif SplitStr(Message,"%s")[1]:lower() == Prefix.."gear" and Admins[User.Name] >= 2 then
  174. local Players = FindPlayer(User,SplitStr(Message,"%s")[2])
  175. for i = 1,#Players do
  176. local Asset = game:service("InsertService"):LoadAsset(SplitStr(Message,"%s")[3])
  177. if Asset ~= nil then
  178. for _,v in ipairs(Asset:GetChildren()) do
  179. v.Parent = Players[i].Backpack
  180. end
  181. wait()
  182. Asset:Destroy()
  183. else
  184. end
  185. end
  186. end
  187. end
  188. end)
  189. end
  190.  
  191. local function pAdded(Player)
  192. if Player.userId == game.CreatorId then
  193. table.insert(Admins,Player.Name == 5)
  194. end
  195. wait(.1)
  196. ConnectAdminChat(Player)
  197. if Banned[Player.Name] == true then
  198. repeat wait() until Player.Parent == Players
  199. Player:Kick()
  200. end
  201. end
  202.  
  203. Players.PlayerAdded:connect(function(Player)
  204. pAdded(Player)
  205. end)
  206.  
  207. for _,v in pairs(Players:GetChildren()) do
  208. pAdded(v)
  209. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement