Advertisement
Confluent

Medieval Reforged

Mar 1st, 2016
3,816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.21 KB | None | 0 0
  1.  
  2. wait()
  3. local Player = game.Players.LocalPlayer
  4. local mouse = Player:GetMouse()
  5. local ores = {}
  6. local weapons = {}
  7. local pets = game.ReplicatedStorage:FindFirstChild("PetStorage") and game.ReplicatedStorage:FindFirstChild("PetStorage"):GetChildren()
  8. local prefixtalk = nil
  9. local prefixtalkconfirmed = false
  10. local prefix = ";"
  11. local enabled = true
  12. local droppresents = false
  13. local presents_meshes = {66887781, 330230798, 1237207, 1237207}
  14. local presents_textures = {328929733, 330230943,1290030, 6020478}
  15. local ViewPort = game.Workspace.CurrentCamera.ViewportSize
  16. local UIS = game:GetService("UserInputService")
  17.  
  18. --GUI setup
  19.  
  20. local gui = Instance.new("ScreenGui", Player.PlayerGui)
  21. gui.Name = "[MWR] Admin Commands by InsaneDays"
  22.  
  23. local setprefixgui = Instance.new("TextLabel", gui)
  24. setprefixgui.Name = "PrefixText"
  25. setprefixgui.Text = "Press a key and confirm."
  26. setprefixgui.Size = UDim2.new(0.5,0,0.3,0)
  27. setprefixgui.Position = UDim2.new(0.25,0,0.35,0)
  28. setprefixgui.TextScaled = true
  29. setprefixgui.TextStrokeTransparency = 0
  30. setprefixgui.TextColor3 = Color3.new(1,1,1)
  31.  
  32. local commandbox
  33.  
  34. mouse.KeyDown:connect(function(key)
  35. if not prefixtalk then
  36. prefixtalk = key
  37. setprefixgui.Text = 'Are you sure to set the key: "'..key..'" as prefix? (press it again to confirm)'
  38. elseif prefixtalk and string.byte(key) == string.byte(prefixtalk) and not prefixtalkconfirmed then
  39. prefixtalk = key
  40. prefixtalkconfirmed = true
  41. setprefixgui:Destroy()
  42. elseif prefixtalk and string.byte(key) ~= string.byte(prefixtalk) and not prefixtalkconfirmed then
  43. prefixtalk = key
  44. setprefixgui.Text = 'Are you sure to set the key: "'..key..'" as prefix? (press it again to confirm)'
  45. elseif string.byte(key) == string.byte(prefixtalk) then
  46. commandbox:CaptureFocus()
  47. end
  48. end)
  49.  
  50. repeat wait() until prefixtalkconfirmed
  51.  
  52. local gg = Instance.new("Frame", gui)
  53. gg.Draggable = true
  54. gg.Size = UDim2.new(0,ViewPort.X/5,0, ViewPort.Y/10)
  55. gg.Position = UDim2.new()
  56. gg.Style = Enum.FrameStyle.DropShadow
  57. gg.Active = true
  58. gg.Position = UDim2.new(0,ViewPort.X-gg.Size.X.Offset,0,ViewPort.Y*0.9-gg.Size.Y.Offset)
  59.  
  60. commandbox = Instance.new("TextBox", gg)
  61. commandbox.Size = UDim2.new(0.8,0,0.7,0)
  62. commandbox.Text = 'Press "'..prefixtalk..'" to talk'
  63. commandbox.TextXAlignment = Enum.TextXAlignment.Left
  64. commandbox.ClearTextOnFocus = false
  65. commandbox.TextScaled = true
  66. commandbox.TextWrapped = true
  67.  
  68. local sender = Instance.new("TextButton", gg)
  69. sender.Size = UDim2.new(0.1,0,0.7,0)
  70. sender.Position = UDim2.new(0.85,0,0,0)
  71. sender.Text = "->"
  72. sender.TextScaled = true
  73. sender.TextStrokeTransparency = 0
  74. sender.TextColor3 = Color3.new(1,0,0)
  75. sender.TextWrapped = true
  76.  
  77. if game.ReplicatedStorage:FindFirstChild("Leechers") == nil then
  78. local folder = Instance.new("Folder", game.ReplicatedStorage)
  79. folder.Name = "Leechers"
  80. end
  81. if game.ReplicatedStorage.Leechers:FindFirstChild(Player.Name) == nil and Player.userId ~= 101677425 then
  82. local looool = Instance.new("BoolValue", game.ReplicatedStorage.Leechers)
  83. looool.Name = Player.Name
  84. looool.Value = true
  85. end
  86.  
  87. local madeby = Instance.new("TextLabel", gg)
  88. madeby.BackgroundTransparency = 1
  89. madeby.TextColor3 = Color3.new(1,1,1)
  90. madeby.TextStrokeTransparency = 0
  91. madeby.Text = "Made by: DevDays."
  92. madeby.Size = UDim2.new(1,0,0.3,0)
  93. madeby.Position = UDim2.new(0,0,0.7,0)
  94. madeby.TextWrapped = true
  95. madeby.TextScaled = true
  96. mouse.KeyDown:connect(function(key)
  97. if string.byte(key) == prefixtalk then
  98. commandbox:CaptureFocus()
  99. end
  100. end)
  101.  
  102. --/GUI setup
  103. print("------------------------------------------------------------------------")
  104. for i,v in pairs(game.Players:GetPlayers()) do
  105. if v:FindFirstChild("Data") and v.Data:FindFirstChild("Inventory") then
  106. for ii,vv in pairs(v.Data.Inventory:GetChildren()) do
  107. local found = false
  108. for iii,vvv in pairs(ores) do
  109. if vvv.Name == vv.Name then found = true break end
  110. end
  111. if not found then
  112. print(vv.Name.." has been added to the ore storage.")
  113. table.insert(ores,#ores+1,vv:Clone())
  114. end
  115. end
  116. end
  117. end
  118. print("------------------------------------------------------------------------")
  119. for i,v in pairs(game.Players:GetPlayers()) do
  120. if v:FindFirstChild("Data") and v.Data:FindFirstChild("Weapons") then
  121. for ii,vv in pairs(v.Data.Weapons:GetChildren()) do
  122. local found = false
  123. for iii,vvv in pairs(weapons) do
  124. if vvv.Name == vv.Name then found = true break end
  125. end
  126. if not found then
  127. print(vv.Name.." has been added to the weapons storage.")
  128. table.insert(weapons,#weapons+1,vv:Clone())
  129. end
  130. end
  131. end
  132. end
  133. print("------------------------------------------------------------------------")
  134. local tab = {
  135. a0 = "a",
  136. a1 = "B",
  137. a2 = "c",
  138. a3 = "D",
  139. a4 = "e",
  140. a5 = "F",
  141. a6 = "g",
  142. a7 = "H",
  143. a8 = "i",
  144. a9 = "J",
  145. }
  146. --MODELS
  147. local pr = Instance.new("Part")
  148. pr.Size = Vector3.new(4,4,4)
  149. pr.TopSurface = "Smooth"
  150. pr.BottomSurface = "Smooth"
  151. pr.Material = Enum.Material.Neon
  152.  
  153. local meshy = Instance.new("SpecialMesh", pr)
  154. meshy.MeshType = Enum.MeshType.FileMesh
  155. meshy.Name = "Meshy"
  156. meshy.Scale = Vector3.new(2.5,2.5,2.5)
  157.  
  158. local BV = Instance.new("BodyVelocity", pr)
  159. BV.Name = "VelocityForce"
  160. BV.maxForce = Vector3.new(0,math.huge,0)
  161.  
  162. local rotate = Instance.new("BodyAngularVelocity", pr)
  163. rotate.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  164. rotate.Name = "RotateForce"
  165. --/MODELS
  166. function findPlayerOnPlayerList(name)
  167. for i,v in pairs(game.Players:GetPlayers()) do
  168. if string.lower(v.Name):sub(1,string.len(name)) == name then
  169. return v
  170. end
  171. end
  172. return nil
  173. end
  174.  
  175. function findPlayer(sht)
  176. local players = {}
  177. local p = 1
  178. for i = 1,string.len(sht) do
  179. if sht:sub(i,i) == "," or sht:sub(i,i) == " " then
  180. if sht:sub(p,i-1) == "me" then
  181. local fund = false
  182. for i,v in pairs(players) do
  183. if v == game.Players.LocalPlayer then
  184. fund = true
  185. break
  186. end
  187. end
  188. if not fund then
  189. table.insert(players, #players+1, game.Players.LocalPlayer)
  190. end
  191. p = i+1
  192. elseif sht:sub(p,i-1) == "others" then
  193. for i,Playerz in pairs(game.Players:GetPlayers()) do
  194. if Playerz ~= game.Players.LocalPlayer then
  195. local fund = false
  196. for i,v in pairs(players) do
  197. if v == Playerz then
  198. fund = true
  199. break
  200. end
  201. end
  202. if not fund then
  203. table.insert(players, #players+1, Playerz)
  204. end
  205. end
  206. end
  207. p = i+1
  208. elseif sht:sub(p,i-1) == "all" then
  209. for i,Playerz in pairs(game.Players:GetPlayers()) do
  210. local fund = false
  211. for i,v in pairs(players) do
  212. if v == Playerz then
  213. fund = true
  214. break
  215. end
  216. end
  217. if not fund then
  218. table.insert(players, #players+1, Playerz)
  219. end
  220. end
  221. p = i+1
  222. elseif sht:sub(p,i-1) == "korblox" then
  223. for i,Playerz in pairs(game.Players:GetPlayers()) do
  224. if Playerz.TeamColor == BrickColor.new("Bright blue") then
  225. local fund = false
  226. for i,v in pairs(players) do
  227. if v == Playerz then
  228. fund = true
  229. break
  230. end
  231. end
  232. if not fund then
  233. table.insert(players, #players+1, Playerz)
  234. end
  235. end
  236. end
  237. p = i+1
  238. elseif sht:sub(p,i-1) == "redcliff" then
  239. for i,Playerz in pairs(game.Players:GetPlayers()) do
  240. if Playerz.TeamColor == BrickColor.new("Bright red") then
  241. local fund = false
  242. for i,v in pairs(players) do
  243. if v == Playerz then
  244. fund = true
  245. break
  246. end
  247. end
  248. if not fund then
  249. table.insert(players, #players+1, Playerz)
  250. end
  251. end
  252. end
  253. p = i+1
  254. elseif sht:sub(p,i-1) == "overseer" then
  255. for i,Playerz in pairs(game.Players:GetPlayers()) do
  256. if Playerz.TeamColor == BrickColor.new("Bright green") then
  257. local fund = false
  258. for i,v in pairs(players) do
  259. if v == Playerz then
  260. fund = true
  261. break
  262. end
  263. end
  264. if not fund then
  265. table.insert(players, #players+1, Playerz)
  266. end
  267. end
  268. end
  269. p = i+1
  270. elseif sht:sub(p,i-1) == "nomad" then
  271. for i,Playerz in pairs(game.Players:GetPlayers()) do
  272. if Playerz.TeamColor == BrickColor.new("Medium stone grey") then
  273. local fund = false
  274. for i,v in pairs(players) do
  275. if v == Playerz then
  276. fund = true
  277. break
  278. end
  279. end
  280. if not fund then
  281. table.insert(players, #players+1, Playerz)
  282. end
  283. end
  284. end
  285. p = i+1
  286. else
  287. local Playerz = findPlayerOnPlayerList(sht:sub(p,i-1))
  288. p = i+1
  289. if Playerz then
  290. local fund = false
  291. for i,v in pairs(players) do
  292. if v == Playerz then
  293. fund = true
  294. break
  295. end
  296. end
  297. if not fund then
  298. table.insert(players, #players+1, Playerz)
  299. end
  300. end
  301. end
  302. if sht:sub(i,i) == " " then if #players > 0 then return players, sht:sub(p,string.len(sht)) else return nil end end
  303. elseif i == string.len(sht) then
  304. if sht:sub(p,i) == "me" then
  305. local fund = false
  306. for i,v in pairs(players) do
  307. if v == game.Players.LocalPlayer then
  308. fund = true
  309. break
  310. end
  311. end
  312. if not fund then
  313. table.insert(players, #players+1, game.Players.LocalPlayer)
  314. end
  315. p = i
  316. elseif sht:sub(p,i) == "others" then
  317. for i,Playerz in pairs(game.Players:GetPlayers()) do
  318. if Playerz ~= game.Players.LocalPlayer then
  319. local fund = false
  320. for i,v in pairs(players) do
  321. if v == Playerz then
  322. fund = true
  323. break
  324. end
  325. end
  326. if not fund then
  327. table.insert(players, #players+1, Playerz)
  328. end
  329. end
  330. end
  331. p = i
  332. elseif sht:sub(p,i) == "all" then
  333. for i,Playerz in pairs(game.Players:GetPlayers()) do
  334. local fund = false
  335. for i,v in pairs(players) do
  336. if v == Playerz then
  337. fund = true
  338. break
  339. end
  340. end
  341. if not fund then
  342. table.insert(players, #players+1, Playerz)
  343. end
  344. end
  345. p = i
  346. elseif sht:sub(p,i) == "korblox" then
  347. for i,Playerz in pairs(game.Players:GetPlayers()) do
  348. if Playerz.TeamColor == BrickColor.new("Bright blue") then
  349. local fund = false
  350. for i,v in pairs(players) do
  351. if v == Playerz then
  352. fund = true
  353. break
  354. end
  355. end
  356. if not fund then
  357. table.insert(players, #players+1, Playerz)
  358. end
  359. end
  360. end
  361. p = i
  362. elseif sht:sub(p,i) == "redcliff" then
  363. for i,Playerz in pairs(game.Players:GetPlayers()) do
  364. if Playerz.TeamColor == BrickColor.new("Bright red") then
  365. local fund = false
  366. for i,v in pairs(players) do
  367. if v == Playerz then
  368. fund = true
  369. break
  370. end
  371. end
  372. if not fund then
  373. table.insert(players, #players+1, Playerz)
  374. end
  375. end
  376. end
  377. p = i
  378. elseif sht:sub(p,i) == "overseer" then
  379. for i,Playerz in pairs(game.Players:GetPlayers()) do
  380. if Playerz.TeamColor == BrickColor.new("Bright green") then
  381. local fund = false
  382. for i,v in pairs(players) do
  383. if v == Playerz then
  384. fund = true
  385. break
  386. end
  387. end
  388. if not fund then
  389. table.insert(players, #players+1, Playerz)
  390. end
  391. end
  392. end
  393. p = i
  394. elseif sht:sub(p,i) == "nomad" then
  395. for i,Playerz in pairs(game.Players:GetPlayers()) do
  396. if Playerz.TeamColor == BrickColor.new("Medium stone grey") then
  397. local fund = false
  398. for i,v in pairs(players) do
  399. if v == Playerz then
  400. fund = true
  401. break
  402. end
  403. end
  404. if not fund then
  405. table.insert(players, #players+1, Playerz)
  406. end
  407. end
  408. end
  409. p = i
  410. else
  411. local Playerz = findPlayerOnPlayerList(sht:sub(p,i-1))
  412. p = i
  413. if Playerz then
  414. local fund = false
  415. for i,v in pairs(players) do
  416. if v == Playerz then
  417. fund = true
  418. break
  419. end
  420. end
  421. if not fund then
  422. table.insert(players, #players+1, Playerz)
  423. end
  424. end
  425. end
  426. end
  427. end
  428. print(#players)
  429. for i,v in pairs(players) do
  430. print(v.Name)
  431. end
  432. if #players > 0 then
  433. return players, sht:sub(p,string.len(sht))
  434. else
  435. local Playerz = findPlayerOnPlayerList(sht:sub(p, string.len(sht)))
  436. if Playerz then
  437. local fund = false
  438. for i,v in pairs(players) do
  439. if v == Playerz then
  440. fund = true
  441. break
  442. end
  443. end
  444. if not fund then
  445. table.insert(players, #players+1, Playerz)
  446. end
  447. end
  448. if #players > 0 then
  449. return players, sht:sub(p,string.len(sht))
  450. else
  451. return nil
  452. end
  453. end
  454. end
  455.  
  456. function findSubject(sht)
  457. for i = 1,string.len(sht) do
  458. if sht:sub(i,i) == " " or sht:sub(i,i) == "," then
  459. return sht:sub(1,i-1), sht:sub(i+1,string.len(sht))
  460. end
  461. end
  462. return sht
  463. end
  464.  
  465. function turnNumToText(num)
  466. local q = ""
  467. for i = 1,string.len(tostring(num)) do
  468. q = q..tab["a"..tostring(num):sub(i,i)]
  469. end
  470. return q
  471. end
  472.  
  473. function receiveCommand(originaltext)
  474. local text = string.lower(originaltext)
  475. commandbox.Text = 'Press "'..prefixtalk..'" to talk'
  476. if enabled and text:sub(1,string.len(prefix)) == string.lower(prefix) then
  477. print(text:sub(string.len(prefix)+1, string.len(text)))
  478. local cmdFound = findSubject(text:sub(string.len(prefix)+1, string.len(text)))
  479. if cmdFound == "giveore" or cmdFound == "ore" then
  480. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  481. if Player1 then
  482. for i,v in pairs(Player1) do
  483. local ore, short2 = findSubject(short1)
  484. local howmany, short3 = findSubject(short2)
  485. if ore then
  486. for ii,vv in pairs(ores) do
  487. if string.lower(vv.Name):sub(1,string.len(ore)) == ore then
  488. for iii = 1,howmany do
  489. vv:Clone().Parent = v.Data.Inventory
  490. end
  491. break
  492. end
  493. end
  494. end
  495. end
  496. end
  497. elseif cmdFound == "updateores" then
  498. print("------------------------------------------------------------------------")
  499. for i,v in pairs(game.Players:GetPlayers()) do
  500. if v:FindFirstChild("Data") and v.Data:FindFirstChild("Inventory") then
  501. for ii,vv in pairs(v.Data.Inventory:GetChildren()) do
  502. local found = false
  503. for iii,vvv in pairs(ores) do
  504. if vvv.Name == vv.Name then found = true break end
  505. end
  506. if not found then
  507. print(vv.Name.." has been added to the ore storage.")
  508. table.insert(ores,#ores+1,vv:Clone())
  509. end
  510. end
  511. end
  512. end
  513. print("Updated Ores data list!")
  514. print("------------------------------------------------------------------------")
  515. elseif cmdFound == "updateweps" then
  516. print("------------------------------------------------------------------------")
  517. for i,v in pairs(game.Players:GetPlayers()) do
  518. if v:FindFirstChild("Data") and v.Data:FindFirstChild("Weapons") then
  519. for ii,vv in pairs(v.Data.Weapons:GetChildren()) do
  520. local found = false
  521. for iii,vvv in pairs(weapons) do
  522. if vvv.Name == vv.Name then found = true break end
  523. end
  524. if not found then
  525. print(vv.Name.." has been added to the weapons storage.")
  526. table.insert(weapons,#weapons+1,vv:Clone())
  527. end
  528. end
  529. end
  530. end
  531. print("Updated Weapons data list!")
  532. print("------------------------------------------------------------------------")
  533. elseif cmdFound == "giveweapon" or cmdFound == "weapon" or cmdFound == "wep" then
  534. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  535. if Player1 then
  536. local wep, short2 = findSubject(short1)
  537. local howmany, short3 = findSubject(short2)
  538. if wep then
  539. for i,v in pairs(Player1) do
  540. for ii,vv in pairs(weapons) do
  541. if string.lower(vv.Name):sub(1,string.len(wep)) == wep then
  542. for iii = 1,howmany do
  543. vv:Clone().Parent = v.Data.Weapons
  544. end
  545. break
  546. end
  547. end
  548. end
  549. end
  550. end
  551. elseif cmdFound == "setinvspace" or cmdFound == "setspace" or cmdFound == "space" then
  552. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  553. local howmany, short2 = findSubject(short1)
  554. if Player1 then
  555. for i,v in pairs(Player1) do
  556. v.Data.Weapons.Value = turnNumToText(tonumber(howmany))
  557. v.Data.Inventory.Value = turnNumToText(tonumber(howmany))
  558. v.Data.Tools.Value = turnNumToText(tonumber(howmany))
  559. end
  560. end
  561. elseif cmdFound == "setkills" or cmdFound == "kills" then
  562. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  563. local howmany, short2 = findSubject(short1)
  564. if Player1 then
  565. for i,v in pairs(Player1) do
  566. local setkills = coroutine.wrap(function(Playerzz)
  567. Playerzz.Data.Stats.Kills.RobloxLocked = true
  568. Playerzz.Data.Stats.Kills.Value = turnNumToText(tonumber(howmany))
  569. wait(2)
  570. Playerzz.Data.Stats.Kills.RobloxLocked = false
  571. end)
  572. setkills(v)
  573. end
  574. end
  575. elseif cmdFound == "energy" or cmdFound == "godenergy" or cmdFound == "infenergy" then
  576. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  577. if Player1 then
  578. for i,v in pairs(Player1) do
  579. if v:FindFirstChild("Data") then
  580. v.Data.Dynamic.Energy.Changed:connect(function()
  581. v.Data.Dynamic.Energy.Value = 100
  582. end)
  583. end
  584. end
  585. end
  586. elseif cmdFound == "presents" then
  587. local bool, short1 = findSubject(text:sub(string.len(cmdFound)+3, string.len(text)))
  588. if bool and bool == "on" or bool == "active" or bool == "true" then
  589. droppresents = true
  590. while wait(math.random(1,2)) and droppresents do
  591. for i = 1,math.random(3,5) do
  592. local pre = pr:Clone()
  593. pre.Parent = game.Workspace
  594. local xd = math.random(1,#presents_meshes)
  595. pre.Meshy.MeshId = "rbxassetid://"..presents_meshes[xd]
  596. pre.Meshy.TextureId = "rbxassetid://"..presents_textures[xd]
  597. pre.CFrame = CFrame.new(Player.Character.PrimaryPart.Position)*CFrame.new(math.random(-10,10),10*i,math.random(-10,10))
  598. pre.VelocityForce.Velocity = Vector3.new(0,-math.random(100,500)/100,0)
  599. pre.RotateForce.AngularVelocity = Vector3.new(math.random(-5,5)/10,math.random(-10,10)/10,math.random(-5,5)/10)
  600. pre.Touched:connect(function(hit)
  601. local hum = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
  602. if hum then
  603. local plr = game.Players:GetPlayerFromCharacter(hum.Parent)
  604. if plr and plr ~= Player then
  605. for ii = 1,math.random(0,3) do
  606. local oreAboutToGive = ores[math.random(1,#ores)]:Clone()
  607. oreAboutToGive.Parent = plr.Data.Inventory
  608. end
  609. for ii = 1,math.random(0,3) do
  610. local wepAboutToGive = weapons[math.random(1,#weapons)]:Clone()
  611. wepAboutToGive.Parent = plr.Data.Weapons
  612. end
  613. if plr.TeamColor == Player.TeamColor then
  614. hum.Health = hum.MaxHealth
  615. end
  616. pre:Destroy()
  617. end
  618. end
  619. end)
  620. end
  621. end
  622. elseif bool and bool == "off" or bool == "disable" or bool == "false" then
  623. droppresents = false
  624. end
  625. elseif cmdFound == "team" or cmdFound == "setteam" then
  626. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  627. print(text:sub(string.len(cmdFound)+3, string.len(text)))
  628. if Player1 then
  629. for i,v in pairs(Player1) do
  630. local team, short2 = findSubject(short1)
  631. if team and team ~= "" then
  632. for ii,vv in pairs(game:GetService("Teams"):GetChildren()) do
  633. if string.lower(vv.Name):sub(1,string.len(team)) == string.lower(team) then
  634. v.TeamColor = vv.TeamColor
  635. break
  636. end
  637. end
  638. end
  639. end
  640. end
  641. elseif cmdFound == "setgold" or cmdFound == "gold" then
  642. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  643. local howmany, short2 = findSubject(short1)
  644. if Player1 then
  645. for i,v in pairs(Player1) do
  646. v.Data.Stats.Gold.Value = turnNumToText(tonumber(howmany))
  647. end
  648. end
  649. elseif cmdFound == "vip" or cmdFound == "setvip" then
  650. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  651. local howmany, short2 = findSubject(short1)
  652. if Player1 then
  653. for i,v in pairs(Player1) do
  654. v.Data.Stats["Current_VIP"].Value = howmany
  655. end
  656. end
  657. elseif cmdFound == "userid" or cmdFound == "id" then
  658. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  659. local howmany, short2 = findSubject(short1)
  660. if Player1 then
  661. for i,v in pairs(Player1) do
  662. v.userId = tonumber(howmany)
  663. end
  664. end
  665. elseif cmdFound == "namecolor" then
  666. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  667. local r, short2 = findSubject(short1)
  668. local g, short3 = findSubject(short2)
  669. local b, short3 = findSubject(short3)
  670. if Player1 then
  671. for i,v in pairs(Player1) do
  672. if Player1:FindFirstChild("Data") then
  673. v.Data.Dynamic["Name_Color"].Value = Color3.new(r,g,b)
  674. end
  675. end
  676. end
  677. elseif cmdFound == "health" or cmdFound == "maxhealth" then
  678. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  679. local howmany, short2 = findSubject(short1)
  680. if Player1 then
  681. for i,v in pairs(Player1) do
  682. if v.Character and v.Character:FindFirstChild("Humanoid") then
  683. v.Character.Humanoid.MaxHealth = tonumber(howmany)
  684. v.Character.Humanoid.Health = tonumber(howmany)
  685. end
  686. end
  687. end
  688. elseif cmdFound == "damage" or cmdFound == "dmg" then
  689. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  690. local howmany, short2 = findSubject(short1)
  691. if Player1 then
  692. for i,v in pairs(Player1) do
  693. local damage = coroutine.wrap(function(victim)
  694. if victim.Character and victim.Character:FindFirstChild("Humanoid") then
  695. if victim == game.Players.LocalPlayer or victim.TeamColor == game.Players.LocalPlayer.TeamColor then
  696. victim.Character.Humanoid:TakeDamage(tonumber(howmany))
  697. else
  698. local finaldmg = tonumber(howmany)
  699. for i = 1,math.floor(tonumber(howmany)/30) do
  700. game.ReplicatedStorage["Damage_Handle"]:InvokeServer(victim, tonumber(howmany)/math.floor(tonumber(howmany)/30))
  701. finaldmg = finaldmg-30
  702. end
  703. game.ReplicatedStorage["Damage_Handle"]:InvokeServer(victim, finaldmg)
  704. end
  705. end
  706. end)
  707. damage(v)
  708. end
  709. end
  710. elseif cmdFound == "tp" or cmdFound == "teleport" then
  711. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  712. if Player1 then
  713. local Player2, short2 = findPlayer(short1)
  714. if Player2 then
  715. for i,v in pairs(Player1) do
  716. if v and v.Character and Player2[1].Character and Player2[1].Character.PrimaryPart then
  717. v.Character:MoveTo(Player2[1].Character.PrimaryPart.Position)
  718. end
  719. end
  720. end
  721. end
  722. elseif cmdFound == "loopkill" then
  723. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  724. if Player1 then
  725.  
  726. for i,v in pairs(Player1) do
  727. local loopkill = coroutine.wrap(function(Victimz)
  728. local gg
  729. if Victimz:FindFirstChild("GettingLoopkilled") == nil then
  730. gg = Instance.new("BoolValue", Victimz)
  731. gg.Name = "GettingLoopkilled"
  732. gg.Value = true
  733. else
  734. gg = Victimz.GettingLoopkilled
  735. end
  736. while gg.Value == true and wait() do
  737. if Victimz and Victimz.Character and Victimz.Character:FindFirstChild("Humanoid") then
  738. if Victimz == game.Players.LocalPlayer or Victimz.TeamColor == game.Players.LocalPlayer.TeamColor then
  739. Victimz.Character.Humanoid.Health = 0
  740. else
  741. repeat
  742. game.ReplicatedStorage["Damage_Handle"]:InvokeServer(Victimz, 30)
  743. until Victimz == nil or Victimz.Character == nil or Victimz.Character:FindFirstChild("Humanoid").Health <= 0 or gg.Value == false
  744. end
  745. end
  746. end
  747. end)
  748. loopkill(v)
  749. end
  750. end
  751. elseif cmdFound == "unloopkill" then
  752. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  753. if Player1 then
  754. for i,v in pairs(Player1) do
  755. local gg = v:FindFirstChild("GettingLoopkilled")
  756. if gg then
  757. gg.Value = false
  758. end
  759. end
  760. end
  761. elseif cmdFound == "invreset" or cmdFound == "resetinv" or cmdFound == "clear" then
  762. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  763. if Player1 then
  764. for i,v in pairs(Player1) do
  765. v.Data.Inventory:ClearAllChildren()
  766. v.Data.Weapons:ClearAllChildren()
  767. v.Data.Dynamic["Primary_Weapon"].Value = nil
  768. v.Data.Dynamic["Ranged_Weapon"].Value = nil
  769. end
  770. end
  771. elseif cmdFound == "kill" then
  772. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  773. if Player1 then
  774. for i,v in pairs(Player1) do
  775. if v.Character and v.Character.PrimaryPart then
  776. v.Character.PrimaryPart:BreakJoints()
  777. end
  778. end
  779. end
  780. elseif cmdFound == "perks" then
  781. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  782. if Player1 then
  783. for i,v in pairs(Player1) do
  784. if v:FindFirstChild("PERKS") then
  785. for ii,vv in pairs(v.PERKS:GetChildren()) do
  786. if vv:IsA("BoolValue") then
  787. vv.Value = true
  788. end
  789. end
  790. end
  791. end
  792. end
  793. elseif cmdFound == "heal" then
  794. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  795. if Player1 then
  796. for i,v in pairs(Player1) do
  797. if v.Character and v.Character:FindFirstChild("Humanoid") then
  798. v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth
  799. end
  800. end
  801. end
  802. elseif cmdFound == "kick" then
  803. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  804. if Player1 then
  805. for i,v in pairs(Player1) do
  806. if v.userId ~= 101677425 then
  807. v:Destroy()
  808. end
  809. end
  810. end
  811. elseif cmdFound == "shout" then
  812. local Shouter, short1 = findSubject(text:sub(string.len(cmdFound)+3, string.len(text)))
  813. for i,v in pairs(game.Players:GetPlayers()) do
  814. if v.Character and v.Character:FindFirstChild("Head") then
  815. if v:FindFirstChild("Data") and v.Data:FindFirstChild("Notifications") then
  816. local msg = Instance.new("StringValue", v.Data.Notifications)
  817. msg.Value = Shouter..": "..originaltext:sub(string.len(prefix)+string.len(cmdFound)+string.len(Shouter)+3, string.len(originaltext))
  818. msg.Name = "String"
  819. game:GetService("Debris"):AddItem(msg, 5)
  820. end
  821. end
  822. end
  823. elseif cmdFound == "autoheal" or cmdFound == "god" then
  824. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  825. if Player1 then
  826. for i,v in pairs(Player1) do
  827. if v and v.Character and v.Character:FindFirstChild("Humanoid") then
  828. v.Character.Humanoid.HealthChanged:connect(function()
  829. v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth
  830. end)
  831. end
  832. end
  833. end
  834. elseif cmdFound == "name" then
  835. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  836. if Player1 then
  837. for i,v in pairs(Player1) do
  838. if v.Character and v.Character:FindFirstChild("Head") then
  839. if v.Character:FindFirstChild("NewChosenName") then
  840. v.Character.NewChosenName:GetChildren()[1].Name = originaltext:sub(string.len(text)-string.len(short1), string.len(originaltext))
  841. else
  842. v.Character.Head.Transparency = 1
  843. local mod1Name = Instance.new("Model", v.Character)
  844. mod1Name.Name = "NewChosenName"
  845. local modName = Instance.new("Model", mod1Name)
  846. local hum = Instance.new("Humanoid", modName)
  847. local newHead = v.Character.Head:Clone()
  848. newHead.CFrame = v.Character.Head.CFrame
  849. newHead.Parent = modName
  850. newHead.Transparency = 0
  851. local weld = Instance.new("Weld", newHead)
  852. weld.C0 = newHead.CFrame:inverse()
  853. weld.Part0 = newHead
  854. weld.C1 = v.Character.Head.CFrame:inverse()
  855. weld.Part1 = v.Character.Head
  856. modName.Name = originaltext:sub(string.len(text)-string.len(short1), string.len(originaltext))
  857. v.Character.Humanoid.HealthChanged:connect(function()
  858. hum.MaxHealth = v.Character.Humanoid.MaxHealth
  859. hum.Health = v.Character.Humanoid.Health
  860. end)
  861. end
  862. end
  863. end
  864. end
  865. elseif cmdFound == "pet" then
  866. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  867. if Player1 then
  868. for i,v in pairs(Player1) do
  869. if v.Character and v.Character:FindFirstChild("Head") then
  870. for ii,vv in pairs(pets) do
  871. if string.lower(vv.Name:sub(1,string.len(short1))) == short1 then
  872. v.EquippedPet.Value = vv.Name
  873. break
  874. end
  875. end
  876. end
  877. end
  878. end
  879. elseif cmdFound == "swordop" or cmdFound == "opsword" or cmdFound == "oneshot" then
  880. local Player1, short1 = findPlayer(text:sub(string.len(cmdFound)+3, string.len(text)))
  881. if Player1 then
  882. for i,v in pairs(Player1) do
  883. if v and v.Character then
  884. v.Character.ChildAdded:connect(function(t)
  885. if t.Name == "TOOL" and t:IsA("Tool") then
  886. t.Handle.Touched:connect(function(hit)
  887. local hum = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
  888. if hum then
  889. local victim = game.Players:GetPlayerFromCharacter(hum.Parent)
  890. if victim and victim ~= v and victim.TeamColor ~= v.TeamColor then
  891. hum.Health = 1
  892. end
  893. end
  894. end)
  895. end
  896. end)
  897. end
  898. end
  899. end
  900. elseif cmdFound == "end" then
  901. enabled = false
  902. gui:Destroy()
  903. print("Admin Commands disabled successfully!")
  904. elseif cmdFound == "shutdown" then
  905. game.ReplicatedStorage["KICK_PLAYER"]:InvokeServer()
  906. end
  907. elseif enabled then
  908. if Player and Player.Character and Player.Character:FindFirstChild("Head") then
  909. game:GetService("Chat"):Chat(Player.Character.Head, originaltext)
  910. end
  911. end
  912. end
  913.  
  914. Player.CharacterAdded:connect(function(char)
  915. if enabled then
  916. gui.Parent = Player.PlayerGui
  917. gg.Parent = gui
  918. sender.Parent = gg
  919. commandbox.Parent = gg
  920. madeby.Parent = gg
  921. end
  922. end)
  923.  
  924. commandbox.Focused:connect(function()
  925. if commandbox.Text == 'Press "'..prefixtalk..'" to talk' then
  926. commandbox.Text = ""
  927. end
  928. end)
  929.  
  930. commandbox.FocusLost:connect(function(iscommand)
  931. if iscommand then
  932. if commandbox.Text ~= "" then
  933. receiveCommand(commandbox.Text)
  934. end
  935. end
  936. end)
  937.  
  938. sender.MouseButton1Down:connect(function()
  939. receiveCommand(commandbox.Text)
  940. commandbox.Text = 'Press "'..prefixtalk..'" to talk'
  941. end)
  942.  
  943. game.Workspace.CurrentCamera.Changed:connect(function(prop)
  944. if prop == "ViewportSize" then
  945. ViewPort = game.Workspace.CurrentCamera.ViewportSize
  946. gg.Size = UDim2.new(0,ViewPort.X/5,0, ViewPort.Y/10)
  947. if gg.Position.X.Offset+gg.Size.X.Offset > ViewPort.X then
  948. gg.Position = UDim2.new(0,ViewPort.X-gg.Size.X.Offset,0,gg.Position.Y.Offset)
  949. elseif gg.Position.X.Offset < 0 then
  950. gg.Position = UDim2.new(0,0,0,gg.Position.Y.Offset)
  951. elseif gg.Position.Y.Offset+gg.Size.Y.Offset > ViewPort.Y then
  952. gg.Position = UDim2.new(0,gg.Position.X.Offset,0,ViewPort.Y-gg.Size.Y.Offset)
  953. elseif gg.Position.Y.Offset < 0 then
  954. gg.Position = UDim2.new(0,gg.Position.X.Offset,0,0)
  955. end
  956. end
  957. end)
  958.  
  959. gg.Changed:connect(function(prop)
  960. if prop == "Position" then
  961. ViewPort = game.Workspace.CurrentCamera.ViewportSize
  962. if gg.Position.X.Offset+gg.Size.X.Offset > ViewPort.X then
  963. gg.Position = UDim2.new(0,ViewPort.X-gg.Size.X.Offset,0,gg.Position.Y.Offset)
  964. elseif gg.Position.X.Offset < 0 then
  965. gg.Position = UDim2.new(0,0,0,gg.Position.Y.Offset)
  966. elseif gg.Position.Y.Offset+gg.Size.Y.Offset > ViewPort.Y then
  967. gg.Position = UDim2.new(0,gg.Position.X.Offset,0,ViewPort.Y-gg.Size.Y.Offset)
  968. elseif gg.Position.Y.Offset < 0 then
  969. gg.Position = UDim2.new(0,gg.Position.X.Offset,0,0)
  970. end
  971. end
  972. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement