Advertisement
l0k

:D! remade v3

l0k
Oct 28th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.72 KB | None | 0 0
  1. owner = "MVPki"
  2. banned = {"PointedCoded" }
  3. admins = {"MVPki"}
  4. mods = { "Bspurrell", "rogue658", "Dill5000100", "SlimShady", "Shaylya" } -- Add more if you'd like.
  5. superusers = {}
  6. powerusers = { }
  7.  
  8. function checkIfAdmin(name)
  9. for i =1,#admins do
  10. if name==admins[i] then
  11. return true
  12. else
  13. return false
  14. end
  15. end
  16. end
  17. function filler(name)
  18. return true
  19. end
  20. function checkIfMod(name)
  21. for i =1,#mods do
  22. if name==mods[i] then
  23. return true
  24. else
  25. return false
  26. end
  27. end
  28. end
  29. function checkIfSuperUser(name)
  30. for i =1,#superusers do
  31. if name==superusers[i] then
  32. return true
  33. else
  34. return false
  35. end
  36. end
  37. end
  38. function checkIfPowerUser(name)
  39. for i =1,#powerusers do
  40. if name==powerusers[i] then
  41. return true
  42. else
  43. return false
  44. end
  45. end
  46. end
  47. function showMsgAll(text)
  48. local m = Instance.new("Hint")
  49. m.Parent = game.Workspace
  50. m.Text = text
  51. wait(3)
  52. m.Parent = nil
  53. end
  54. function checkIfBanned(player)
  55. for i = 1,#banned do
  56. if player.Name == banned[i] then
  57. player:Remove()
  58. end
  59. end
  60. end
  61. function ban(player)
  62. if player~=nil then
  63. table.insert(banned, player.Name)
  64. player:Remove()
  65. end
  66. end
  67. function kick(player)
  68. if player~=nil then
  69. player:Remove()
  70. end
  71. end
  72. function showMsg(parent, text)
  73. local m = Instance.new("Hint")
  74. m.Parent = parent
  75. m.Text = text
  76. wait(3)
  77. m.Parent = nil
  78. end
  79. function getCall(call, parent)
  80. if call == "" then
  81. showMsg(parent, "Dignity's Admin Commands Script Loaded (V1.7); General Info Accessed.")
  82. showMsg(parent, "Type help/ [item name]/ for help in that topic.")
  83. showMsg(parent, "Commands:")
  84. showMsg(parent, "Type help/give/ [Info on Giving Hopperbins/Tools.")
  85. showMsg(parent, "Type help/sb/ [Info on Script Builder; Select Few Only.")
  86. showMsg(parent, "Type help/setlvl/ [Info on Setting Levels. Owner Only.]")
  87. showMsg(parent, "Type help/s/ [Info on Shoutouts; Select Few Only.")
  88. showMsg(parent, "Type help/kill/ [Info on KillScript; Select Few Only.]")
  89. showMsg(parent, "Type help/ban/ [Info on Banning Users; Select Few Only.]")
  90. showMsg(parent, "Type help/kick/ [Info on Kicking Users; Select Few Only.]")
  91. showMsg(parent, "Type help/maxp/ [Info on Setting Max Players; Select Few Only.]")
  92. showMsg(parent, "Type help/debris/ [Info on Setting Lag-Debris Amount; Owner Only.]")
  93. showMsg(parent, "Type help/ for a list of options according to the script.")
  94. showMsg(parent, "Type help/updates/ for a list of upcoming updates. Free to use.]")
  95. showMsg(parent, "Type help/time/ [Info on Setting Daylight Time; Select Few Only.")
  96. end
  97. if call == "give/" then
  98. showMsg(parent, "Give Toolbar Opened. Type give/[BinType]/[Name]")
  99. showMsg(parent, "To Use, type: give/[BinType]/[Name]")
  100. showMsg(parent, "What it does: Gives a Hopperbin to Name, BinType is set by the BinType section.")
  101. end
  102. if call == "sb/" then
  103. showMsg(parent, "Script Builder Toolbar Opened. Type sb/[Script]")
  104. showMsg(parent, "To Use, type: sb/[Script]")
  105. showMsg(parent, "What it does: Makes a script. It's source is 'Script'.")
  106. end
  107. if call == "setlvl/" then
  108. showMsg(parent, "Setlvl Toolbar Opened. Type setlvl/[Level]/[Name]")
  109. showMsg(parent, "To Use, type: setlvl/[Level]/[Name]")
  110. showMsg(parent, "What it does: Sets User's name to a certain level, on Dignity's Chart.")
  111. showMsg(parent, "Levels vary. Dignity selects whom may use this script. PM him or rogue658 for info regarding this.")
  112. end
  113. if call == "s/" then
  114. showMsg(parent, "Shoutout Toolbar Opened. Type s/[Message]")
  115. showMsg(parent, "To Use, type: s/[Message]")
  116. showMsg(parent, "What it does: Shouts a message of your choice. Use this considerably.")
  117. end
  118. if call == "kill/" then
  119. showMsg(parent, "Kill Toolbar Opened. Type kill/[Name]")
  120. showMsg(parent, "To use, type: kill/[Name]")
  121. showMsg(parent, "What it does: Kills whoevers name I, or any of the admins choose to put there.")
  122. end
  123. if call == "ban/" then
  124. showMsg(parent, "Ban Toolbar Opened. Type bye [Name]")
  125. showMsg(parent, "To use, type: bye [Name]")
  126. showMsg(parent, "What it does: Permanently bans Name until changed from edit mode. Used only by Dignity.")
  127. end
  128. if call == "kick/" then
  129. showMsg(parent, "Kick Toolbar Opened. Type kick/[Name]")
  130. showMsg(parent, "To use, type: kick/[Name]")
  131. showMsg(parent, "What it does: Temporarily kicks user from the server. Admin Only.")
  132. end
  133. if call == "maxp/" then
  134. showMsg(parent, "MaxPlayers Toolbar Opened. Type maxp/[Number]")
  135. showMsg(parent, "To use, type: maxp/[Number]")
  136. showMsg(parent, "What it does: Sets MaxPlayers to Number given. Owner Only.")
  137. end
  138. if call == "debris/" then
  139. showMsg(parent, "Debris Toolbar Opened. Type debris/[Item]")
  140. showMsg(parent, "To Use, type: debris/[Item]")
  141. showMsg(parent, "What it does: Deletes Item server-PERMANENTLY. Creates fix. Owner Only.")
  142. end
  143. if call == "help/" then
  144. showMsg(parent, "Help Toolbar Opened.")
  145. showMsg(parent, "To use, type: help/[Command]")
  146. showMsg(parent, "What it does: Shows help file for Command, Command can be blank.")
  147. end
  148. if call == "updates/" then
  149. showMsg(parent, "Updates Toolbar Opened. Type updates/")
  150. showMsg(parent, "To use, type: updates/")
  151. showMsg(parent, "What it does: Shows current updates, and changes to Dignity's ScriptBuilder.")
  152. end
  153. if call == "time/" then
  154. showMsg(parent, "Time Settings Toolbar Opened. Type time/[TimeOfDay]")
  155. showMsg(parent, "To use, type: time/[game.Lighting.TimeOfDay =]")
  156. showMsg(parent, "What it does: Sets time to the amount of time given. Use considerably.")
  157. end
  158. end
  159. function onChatted(msg,recipient,speaker)
  160. if string.sub(msg,1,5) == "help/" then
  161. getCall(string.sub(msg,6), speaker)
  162. end
  163. if string.sub(msg,1,2) == "s/" and speaker.Level.Value >= 4 then
  164. showMsgAll(string.sub(msg,3))
  165. end
  166. if string.sub(msg,1,3) == "sb/" and speaker.Level.Value >= 4 then
  167. local s = Instance.new("Script")
  168. s.Parent = game.Workspace
  169. s.Disabled = false
  170. s.Name = "NewScript"
  171. s.Source = string.sub(msg,4)
  172. wait(0)
  173. local new = s:Clone()
  174. new.Parent = game.Workspace
  175. s:Remove()
  176. end
  177. if string.sub(msg,1,5) == "give/" and speaker.Level.Value >= 4 then
  178. local p = game.Players:GetChildren()
  179. for i = 1,#p do
  180. if p[i].Name == string.sub(msg,9) then
  181. local h = Instance.new("Hopperbin", "Tool")
  182. h.Parent = p[i].Backpack
  183. h.BinType = tonumber(string.sub(msg,6,6))
  184. end
  185. end
  186. end
  187. if string.sub(msg,1,5) == "maxp/" and speaker.Level.Value >= 4 then
  188. game.Players.MaxPlayers = string.sub(msg,6)
  189. end
  190. if string.sub(msg,1,5) == "kill/" and speaker.Level.Value >= 4 then
  191. local players = game.Players:GetChildren()
  192. for i = 1,#players do
  193. if players[i].Name==string.sub(msg,6) then
  194. if players[i].Character~=nil then
  195. players[i].Character.Humanoid.Health = 0
  196. end
  197. end
  198. end
  199. end
  200. if string.sub(msg,1,5) == "kick/" and speaker.Level.Value >= 4 then
  201. local players = game.Players:GetChildren()
  202. for i = 1,#players do
  203. if players[i].Name==string.sub(msg,6) then
  204. if players[i].Character~=nil then
  205. kick(players[i])
  206. end
  207. end
  208. end
  209. end
  210. if string.sub(msg,1,4) == "bye " and speaker.Level.Value >= 4 then
  211. local players = game.Players:GetChildren()
  212. for i = 1,#players do
  213. if players[i].Name==string.sub(msg,5) then
  214. if players[i].Character~=nil then
  215. ban(players[i])
  216. end
  217. end
  218. end
  219. end
  220. if string.sub(msg,1,7) == "debris/" and speaker.Name == owner then
  221. local g = game.Workspace:GetChildren()
  222. for i = 1,#g do
  223. if g[i].Name==string.sub(msg,8) then
  224. game:GetService("Debris"):AddItem(g[i], 10)
  225. end
  226. end
  227. end
  228. if string.sub(msg,1,7) == "setlvl/" and speaker.Level.Value >= tonumber(string.sub(msg,8,8)) then
  229. local p = game.Players:GetChildren()
  230. for i = 1,#p do
  231. if p[i].Name == string.sub(msg,10) then
  232. p[i].Level.Value = tonumber(string.sub(msg,8,8))
  233. end
  234. end
  235. end
  236. if string.sub(msg,1) == "updates/" then
  237. showMsg(speaker, "Updates:")
  238. showMsg(speaker, "Dignity's V1.7 Commands Uploaded")
  239. showMsg(speaker, "Credits: rogue658")
  240. showMsg(speaker, "There will be no further updates to this script, for this map.")
  241. end
  242. if string.sub(msg,1,5) == "time/" then
  243. game.Lighting.TimeOfDay = string.sub(msg,6)
  244. end
  245. end
  246. function getPlayers(newPlayer)
  247. local level = Instance.new("IntValue")
  248. level.Name = "Level"
  249. local name = newPlayer.Name
  250. if checkIfAdmin(name) then
  251. level.Value = 5
  252. elseif checkIfMod(name) then
  253. level.Value = 4
  254. elseif checkIfSuperUser(name) then
  255. level.Value = 3
  256. elseif checkIfPowerUser(name) then
  257. level.Value = 2
  258. elseif filler(name) then
  259. level.Value = 1
  260. end
  261. level.Parent = newPlayer
  262. checkIfBanned(newPlayer)
  263. newPlayer.Chatted:connect(function(msg,recipient) onChatted(msg,recipient,newPlayer) end)
  264. end
  265. game.Players.ChildAdded:connect(getPlayers)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement