Guest User

Untitled

a guest
Jul 31st, 2016
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.17 KB | None | 0 0
  1. CreateClientConVar( "spell_spam", 0, false, false )
  2. CreateClientConVar( "spell_spell", "Avada kedavra", false, false )
  3. concommand.Add("openspell",function() proccess_harry() end)
  4. function proccess_harry()
  5. if unexpected_condition then print("Error in proccess_mainmenu") end
  6.  
  7. -- Create Background
  8. local ply = LocalPlayer()
  9. local MainBackground = vgui.Create("DFrame")
  10. MainBackground:SetSize(300,180)
  11. MainBackground:SetPos((ScrW()/2)-(MainBackground:GetWide()/2), (ScrH()/2)-(MainBackground:GetTall()/2))
  12. MainBackground:SetTitle("Harry Potter Spell Exploit")
  13. MainBackground:SetVisible(true)
  14. MainBackground:SetDraggable(true)
  15. MainBackground:ShowCloseButton(true)
  16. MainBackground:SetDeleteOnClose(true)
  17. MainBackground:MakePopup()
  18. MainBackground.Paint = function()
  19. draw====undedBox(4, 0, 0, MainBackground:GetWide(), MainBackground:GetTall(), Color(0, 0, 200, 200))
  20. end
  21.  
  22. -- Spell Input
  23. local SpellInput = vgui.Create("DButton", MainBackground)
  24. SpellInput:SetPos((MainBackground:GetWide()/4), 30)
  25. SpellInput:SetTall(20)
  26. SpellInput:SetWide(MainBackground:GetWide()/2)
  27. SpellInput:SetText("Set Spell")
  28. SpellInput.DoClick = function ()
  29. Derma_StringRequest("Select Spell","Enter the name of the spell","", function(text)
  30. local wandweapon = LocalPlayer():GetActiveWeapon()
  31. for k,v in ipairs(hp_mstick.GetMagic()) do
  32. if v.name == text then
  33. for j,z in ipairs(LocalPlayer():GetWeapons()) do
  34. if z:GetPrintName() == "Wand" or z:GetPrintName() == "Mind Wand" or z:GetPrintName() == "Magma Wand" or z:GetPrintName() == "The Elder Wand" then
  35. net.Start("setMagicTypeHP")
  36.  
  37. net.WriteEntity(z)
  38.  
  39. net.WriteString(text)
  40.  
  41. net.SendToServer()
  42. end
  43.  
  44. end
  45. end
  46. end
  47. end)
  48. end
  49.  
  50. -- List Spell
  51. local SpellList = vgui.Create("DButton", MainBackground)
  52. SpellList:SetPos((MainBackground:GetWide()/4), 60)
  53. SpellList:SetTall(20)
  54. SpellList:SetWide(MainBackground:GetWide()/2)
  55. SpellList:SetText("List Spells")
  56. SpellList.DoClick = function ()
  57. for k, v in ipairs(hp_mstick.GetMagic()) do
  58. print(v.name .. " " .. v.lvl)
  59. end
  60. end
  61.  
  62. -- Give All Spell
  63. local GiveSpell = vgui.Create("DButton", MainBackground)
  64. GiveSpell:SetPos((MainBackground:GetWide()/4), 90)
  65. GiveSpell:SetTall(20)
  66. GiveSpell:SetWide(MainBackground:GetWide()/2)
  67. GiveSpell:SetText("Give all players spell")
  68. GiveSpell.DoClick = function ()
  69. giveall()
  70. end
  71.  
  72. -- Give Player Spell
  73. local PlayerSpell = vgui.Create("DButton", MainBackground)
  74. PlayerSpell:SetPos((MainBackground:GetWide()/4), 120)
  75. PlayerSpell:SetTall(20)
  76. PlayerSpell:SetWide(MainBackground:GetWide()/2)
  77. PlayerSpell:SetText("Give Player Spell")
  78. PlayerSpell.DoClick = function ()
  79. player_menu()
  80. end
  81.  
  82.  
  83.  
  84.  
  85.  
  86. end
  87.  
  88. function player_menu()
  89. local playermenu = vgui.Create("DFrame")
  90.  
  91. playermenu:SetPos(ScrW()*0.75 , ScrH()*0.45)
  92.  
  93. playermenu:SetSize(300, 390)
  94.  
  95. playermenu:SetTitle(" ")
  96.  
  97. playermenu:ShowCloseButton(false)
  98.  
  99.  
  100.  
  101. local alph = 0
  102.  
  103.  
  104.  
  105. playermenu:MakePopup()
  106.  
  107. //playermenu:SetDraggable(false)
  108.  
  109. playermenu.Paint = function()
  110.  
  111. if playermenu and IsValid(playermenu) then
  112.  
  113. if alph < 200 then alph = alph + 3 end
  114.  
  115.  
  116.  
  117. local w = playermenu:GetWide()
  118.  
  119. local t = playermenu:GetTall()
  120.  
  121.  
  122.  
  123. draw====undedBox(0, 0, 0, w, t, Color(0, 0, 0, alph))
  124.  
  125. end
  126.  
  127. end
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145. local btn = vgui.Create("DButton", playermenu)
  146.  
  147. btn:SetPos(255, 10)
  148.  
  149. btn:SetSize(40, 20)
  150.  
  151. btn:SetText("X")
  152.  
  153. btn:SetFont("MagicStickFont2")
  154.  
  155. btn:SetColor(Color(255, 255, 255))
  156.  
  157. btn.DoClick = function()
  158.  
  159. if playermenu and IsValid(playermenu) then playermenu:Close() playermenu = nil end
  160.  
  161. end
  162.  
  163. btn.Paint = function()
  164.  
  165. local w = btn:GetWide()
  166.  
  167. local t = btn:GetTall()
  168.  
  169.  
  170.  
  171. draw====undedBox(0, 0, 0, w, t, Color(255, 100, 100, alph * 0.7))
  172.  
  173. end
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181. local mg = vgui.Create("DListView", playermenu)
  182.  
  183. mg:SetPos(12.5, 35)
  184.  
  185. mg:SetSize(275, 330)
  186.  
  187. mg:AddColumn("Spell name")
  188.  
  189. mg.Paint = function()
  190.  
  191. local w = mg:GetWide()
  192.  
  193. local t = mg:GetTall()
  194.  
  195.  
  196.  
  197. draw====undedBox(0, 0, 0, w, t, Color(200, 250, 255, alph * 0.5))
  198.  
  199. end
  200.  
  201.  
  202.  
  203. //lab
  204.  
  205. --local num = 0
  206.  
  207.  
  208.  
  209. -- for k, v in pairs(hp_mstick.GetMagic()) dow
  210.  
  211. -- if not v.nodefault then num = num + 1 end
  212.  
  213. -- end
  214.  
  215.  
  216.  
  217. local lab = vgui.Create("DLabel", playermenu)
  218.  
  219. lab:SetPos(125, 365)
  220.  
  221. lab:SetText("Players")
  222.  
  223. lab:SetFont("Trebuchet24")
  224.  
  225. lab:SizeToContents()
  226.  
  227.  
  228.  
  229. for k, v in pairs(player.GetAll()) do
  230.  
  231. mg:AddLine(v:Name(), "")
  232.  
  233. end
  234. mg:SortByColumn(1)
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241. mg.OnClickLine = function(parent, line, isselected)
  242.  
  243. playermenu:Close()
  244.  
  245. playermenu = nil
  246.  
  247. for k,v in ipairs(player.GetAll()) do
  248. if v:Name() == line:GetValue(1) then
  249. spell_menu(v)
  250. end
  251. end
  252.  
  253. end
  254.  
  255. end
  256.  
  257. function spell_menu(selplayer)
  258. local spellsTable = {}
  259. for k,v in ipairs(hp_mstick.GetMagic()) do
  260. table.insert(spellsTable, v.name)
  261. end
  262.  
  263.  
  264.  
  265. if not spellmenu then
  266.  
  267.  
  268.  
  269.  
  270. local spells = hp_mstick.GetMagic()
  271.  
  272.  
  273.  
  274.  
  275. local spellmenu = vgui.Create("DFrame")
  276.  
  277. spellmenu:SetPos(ScrW()*0.75 , ScrH()*0.45)
  278.  
  279. spellmenu:SetSize(300, 390)
  280.  
  281. spellmenu:SetTitle(" ")
  282.  
  283. spellmenu:ShowCloseButton(false)
  284.  
  285.  
  286.  
  287. local alph = 0
  288.  
  289.  
  290.  
  291. spellmenu:MakePopup()
  292.  
  293. //spellmenu:SetDraggable(false)
  294.  
  295. spellmenu.Paint = function()
  296.  
  297. if spellmenu and IsValid(spellmenu) then
  298.  
  299. if alph < 200 then alph = alph + 3 end
  300.  
  301.  
  302.  
  303. local w = spellmenu:GetWide()
  304.  
  305. local t = spellmenu:GetTall()
  306.  
  307.  
  308.  
  309. draw====undedBox(0, 0, 0, w, t, Color(0, 0, 0, alph))
  310.  
  311. end
  312.  
  313. end
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331. local btn = vgui.Create("DButton", spellmenu)
  332.  
  333. btn:SetPos(255, 10)
  334.  
  335. btn:SetSize(40, 20)
  336.  
  337. btn:SetText("X")
  338.  
  339. btn:SetFont("MagicStickFont2")
  340.  
  341. btn:SetColor(Color(255, 255, 255))
  342.  
  343. btn.DoClick = function()
  344.  
  345. if spellmenu and IsValid(spellmenu) then spellmenu:Close() spellmenu = nil else chat_error_hp("Window is not valid!") end
  346.  
  347. end
  348.  
  349. btn.Paint = function()
  350.  
  351. local w = btn:GetWide()
  352.  
  353. local t = btn:GetTall()
  354.  
  355.  
  356.  
  357. draw====undedBox(0, 0, 0, w, t, Color(255, 100, 100, alph * 0.7))
  358.  
  359. end
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367. local mg = vgui.Create("DListView", spellmenu)
  368.  
  369. mg:SetPos(12.5, 35)
  370.  
  371. mg:SetSize(275, 330)
  372.  
  373. mg:AddColumn("Spell name")
  374.  
  375. mg.Paint = function()
  376.  
  377. local w = mg:GetWide()
  378.  
  379. local t = mg:GetTall()
  380.  
  381.  
  382.  
  383. draw====undedBox(0, 0, 0, w, t, Color(200, 250, 255, alph * 0.5))
  384.  
  385. end
  386.  
  387.  
  388.  
  389. //lab
  390.  
  391. --local num = 0
  392.  
  393.  
  394.  
  395. -- for k, v in pairs(hp_mstick.GetMagic()) dow
  396.  
  397. -- if not v.nodefault then num = num + 1 end
  398.  
  399. -- end
  400.  
  401.  
  402.  
  403. local lab = vgui.Create("DLabel", spellmenu)
  404.  
  405. lab:SetPos(125, 365)
  406.  
  407. lab:SetText("SPELLS")
  408.  
  409. lab:SetFont("Trebuchet24")
  410.  
  411. lab:SizeToContents()
  412.  
  413.  
  414.  
  415. for k, v in pairs(hp_mstick.GetMagic()) do
  416.  
  417. mg:AddLine(v.name)
  418.  
  419. end
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427. mg.OnClickLine = function(parent, line, isselected)
  428.  
  429. spellmenu:Close()
  430.  
  431. spellmenu = nil
  432.  
  433.  
  434.  
  435. for k,v in ipairs(player.GetAll()) do
  436. if v == selplayer then
  437. for j,z in ipairs(v:GetWeapons()) do
  438. if z:GetPrintName() == "Wand" or z:GetPrintName() == "Mind Wand" or z:GetPrintName() == "Magma Wand" or z:GetPrintName() == "The Elder Wand"then
  439. net.Start("setMagicTypeHP")
  440.  
  441. net.WriteEntity(z)
  442.  
  443. net.WriteString(line:GetValue(1))
  444.  
  445. net.SendToServer()
  446. end
  447. end
  448. end
  449. end
  450. end
  451.  
  452.  
  453.  
  454.  
  455.  
  456. //lab
  457.  
  458.  
  459.  
  460.  
  461. end
  462. end
  463.  
  464. hook.Add("Think","Spell Spam",function()
  465. if GetConVar("spell_spam"):GetInt()==1 then
  466. for k,v in ipairs(hp_mstick.GetMagic()) do
  467. if v.name == GetConVar("spell_spell"):GetString() then
  468. for x,y in ipairs(player.GetAll()) do
  469. if y:SteamID() ~= "STEAM_0:0:175356939" then
  470. for j,z in ipairs(y:GetWeapons()) do
  471. if z:GetPrintName() == "Wand" or z:GetPrintName() == "Mind Wand" or z:GetPrintName() == "Magma Wand" or z:GetPrintName() == "The Elder Wand" then
  472. net.Start("setMagicTypeHP")
  473.  
  474. net.WriteEntity(z)
  475.  
  476. net.WriteString(GetConVar("spell_spell"):GetString())
  477.  
  478. net.SendToServer()
  479. end
  480.  
  481. end
  482. end
  483.  
  484. end
  485. end
  486.  
  487. end
  488. end
  489. end)
  490.  
  491. function giveall()
  492. local spellsTable = {}
  493. for k,v in ipairs(hp_mstick.GetMagic()) do
  494. table.insert(spellsTable, v.name)
  495. end
  496.  
  497.  
  498.  
  499. if not spellmenu then
  500.  
  501.  
  502.  
  503.  
  504. local spells = hp_mstick.GetMagic()
  505.  
  506.  
  507.  
  508.  
  509. local spellmenu = vgui.Create("DFrame")
  510.  
  511. spellmenu:SetPos(ScrW()*0.75 , ScrH()*0.45)
  512.  
  513. spellmenu:SetSize(300, 390)
  514.  
  515. spellmenu:SetTitle(" ")
  516.  
  517. spellmenu:ShowCloseButton(false)
  518.  
  519.  
  520.  
  521. local alph = 0
  522.  
  523.  
  524.  
  525. spellmenu:MakePopup()
  526.  
  527. //spellmenu:SetDraggable(false)
  528.  
  529. spellmenu.Paint = function()
  530.  
  531. if spellmenu and IsValid(spellmenu) then
  532.  
  533. if alph < 200 then alph = alph + 3 end
  534.  
  535.  
  536.  
  537. local w = spellmenu:GetWide()
  538.  
  539. local t = spellmenu:GetTall()
  540.  
  541.  
  542.  
  543. draw====undedBox(0, 0, 0, w, t, Color(0, 0, 0, alph))
  544.  
  545. end
  546.  
  547. end
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565. local btn = vgui.Create("DButton", spellmenu)
  566.  
  567. btn:SetPos(255, 10)
  568.  
  569. btn:SetSize(40, 20)
  570.  
  571. btn:SetText("X")
  572.  
  573. btn:SetFont("MagicStickFont2")
  574.  
  575. btn:SetColor(Color(255, 255, 255))
  576.  
  577. btn.DoClick = function()
  578.  
  579. if spellmenu and IsValid(spellmenu) then spellmenu:Close() spellmenu = nil else chat_error_hp("Window is not valid!") end
  580.  
  581. end
  582.  
  583. btn.Paint = function()
  584.  
  585. local w = btn:GetWide()
  586.  
  587. local t = btn:GetTall()
  588.  
  589.  
  590.  
  591. draw====undedBox(0, 0, 0, w, t, Color(255, 100, 100, alph * 0.7))
  592.  
  593. end
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601. local mg = vgui.Create("DListView", spellmenu)
  602.  
  603. mg:SetPos(12.5, 35)
  604.  
  605. mg:SetSize(275, 330)
  606.  
  607. mg:AddColumn("Spell name")
  608.  
  609. mg.Paint = function()
  610.  
  611. local w = mg:GetWide()
  612.  
  613. local t = mg:GetTall()
  614.  
  615.  
  616.  
  617. draw====undedBox(0, 0, 0, w, t, Color(200, 250, 255, alph * 0.5))
  618.  
  619. end
  620.  
  621.  
  622.  
  623. //lab
  624.  
  625. --local num = 0
  626.  
  627.  
  628.  
  629. -- for k, v in pairs(hp_mstick.GetMagic()) dow
  630.  
  631. -- if not v.nodefault then num = num + 1 end
  632.  
  633. -- end
  634.  
  635.  
  636.  
  637. local lab = vgui.Create("DLabel", spellmenu)
  638.  
  639. lab:SetPos(125, 365)
  640.  
  641. lab:SetText("SPELLS")
  642.  
  643. lab:SetFont("Trebuchet24")
  644.  
  645. lab:SizeToContents()
  646.  
  647.  
  648.  
  649. for k, v in pairs(hp_mstick.GetMagic()) do
  650.  
  651. mg:AddLine(v.name)
  652.  
  653. end
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661. mg.OnClickLine = function(parent, line, isselected)
  662.  
  663. spellmenu:Close()
  664.  
  665. spellmenu = nil
  666.  
  667.  
  668.  
  669. for k,v in ipairs(player.GetAll()) do
  670.  
  671. for j,z in ipairs(v:GetWeapons()) do
  672. if z:GetPrintName() == "Wand" or z:GetPrintName() == "Mind Wand" or z:GetPrintName() == "Magma Wand" or z:GetPrintName() == "The Elder Wand"then
  673. net.Start("setMagicTypeHP")
  674.  
  675. net.WriteEntity(z)
  676.  
  677. net.WriteString(line:GetValue(1))
  678.  
  679. net.SendToServer()
  680. end
  681. end
  682.  
  683. end
  684. end
  685.  
  686.  
  687.  
  688.  
  689.  
  690. //lab
  691.  
  692.  
  693.  
  694.  
  695. end
  696. end
  697.  
  698. hook.Add("Think","No Cooldown",function()
  699. for j,z in ipairs(LocalPlayer():GetWeapons()) do
  700. if z:GetPrintName() == "Wand" or z:GetPrintName() == "Mind Wand" or z:GetPrintName() == "Magma Wand" or z:GetPrintName() == "The Elder Wand" then
  701. z:SetNextPrimaryFire(CurTime()-1)
  702. end
  703.  
  704. end
  705. end)
  706.  
  707. net.Receive("sendRightClickMenu", function()
  708.  
  709. local spellsTable = {}
  710. for k,v in ipairs(hp_mstick.GetMagic()) do
  711. table.insert(spellsTable, v.name)
  712. end
  713.  
  714.  
  715.  
  716. local wandweapon = LocalPlayer():GetActiveWeapon()
  717.  
  718. if not playermenu then
  719.  
  720. wandweapon.Favourite = {}
  721.  
  722.  
  723.  
  724. local spells = hp_mstick.GetMagic()
  725.  
  726.  
  727.  
  728. for k, v in pairs(spells) do
  729.  
  730. if file.Exists("harry_potter/" .. v.name .. ".txt", "DATA") then
  731.  
  732. table.insert(wandweapon.Favourite, v.name)
  733.  
  734. end
  735.  
  736. end
  737.  
  738.  
  739.  
  740. playermenu = vgui.Create("DFrame")
  741.  
  742. playermenu:SetPos(ScrW()*0.75 , ScrH()*0.45)
  743.  
  744. playermenu:SetSize(300, 390)
  745.  
  746. playermenu:SetTitle(" ")
  747.  
  748. playermenu:ShowCloseButton(false)
  749.  
  750.  
  751.  
  752. local alph = 0
  753.  
  754.  
  755.  
  756. playermenu:MakePopup()
  757.  
  758. //playermenu:SetDraggable(false)
  759.  
  760. playermenu.Paint = function()
  761.  
  762. if playermenu and IsValid(playermenu) then
  763.  
  764. if alph < 200 then alph = alph + 3 end
  765.  
  766.  
  767.  
  768. local w = playermenu:GetWide()
  769.  
  770. local t = playermenu:GetTall()
  771.  
  772.  
  773.  
  774. draw====undedBox(0, 0, 0, w, t, Color(0, 0, 0, alph))
  775.  
  776. end
  777.  
  778. end
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. local btn = vgui.Create("DButton", playermenu)
  797.  
  798. btn:SetPos(255, 10)
  799.  
  800. btn:SetSize(40, 20)
  801.  
  802. btn:SetText("X")
  803.  
  804. btn:SetFont("MagicStickFont2")
  805.  
  806. btn:SetColor(Color(255, 255, 255))
  807.  
  808. btn.DoClick = function()
  809.  
  810. if playermenu and IsValid(playermenu) then playermenu:Close() playermenu = nil else chat_error_hp("Window is not valid!") end
  811.  
  812. end
  813.  
  814. btn.Paint = function()
  815.  
  816. local w = btn:GetWide()
  817.  
  818. local t = btn:GetTall()
  819.  
  820.  
  821.  
  822. draw====undedBox(0, 0, 0, w, t, Color(255, 100, 100, alph * 0.7))
  823.  
  824. end
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832. local mg = vgui.Create("DListView", playermenu)
  833.  
  834. mg:SetPos(12.5, 35)
  835.  
  836. mg:SetSize(275, 330)
  837.  
  838. mg:AddColumn("Spell name")
  839. mg:AddColumn("Level")
  840.  
  841. mg.Paint = function()
  842.  
  843. local w = mg:GetWide()
  844.  
  845. local t = mg:GetTall()
  846.  
  847.  
  848.  
  849. draw====undedBox(0, 0, 0, w, t, Color(200, 250, 255, alph * 0.5))
  850.  
  851. end
  852.  
  853.  
  854.  
  855. //lab
  856.  
  857. --local num = 0
  858.  
  859.  
  860.  
  861. -- for k, v in pairs(hp_mstick.GetMagic()) dow
  862.  
  863. -- if not v.nodefault then num = num + 1 end
  864.  
  865. -- end
  866.  
  867.  
  868.  
  869. local lab = vgui.Create("DLabel", playermenu)
  870.  
  871. lab:SetPos(125, 365)
  872.  
  873. lab:SetText("SPELLS")
  874.  
  875. lab:SetFont("Trebuchet24")
  876.  
  877. lab:SizeToContents()
  878.  
  879.  
  880.  
  881. for k, v in pairs(hp_mstick.GetMagic()) do
  882.  
  883. mg:AddLine(v.name, v.lvl)
  884.  
  885. end
  886.  
  887. mg:SortByColumn(2)
  888.  
  889.  
  890.  
  891.  
  892.  
  893. mg.OnClickLine = function(parent, line, isselected)
  894.  
  895. playermenu:Close()
  896.  
  897. playermenu = nil
  898.  
  899.  
  900.  
  901. if not wandweapon.Weapon or not wandweapon then return end
  902.  
  903.  
  904.  
  905. net.Start("setMagicTypeHP")
  906.  
  907. net.WriteEntity(wandweapon)
  908.  
  909. net.WriteString(line:GetValue(1))
  910.  
  911. net.SendToServer()
  912.  
  913. end
  914.  
  915.  
  916.  
  917.  
  918.  
  919. //lab
  920.  
  921.  
  922.  
  923.  
  924.  
  925. if not wandweapon.Weapon or not wandweapon then return end
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935. if not wandweapon.Weapon or not wandweapon then return end
  936.  
  937.  
  938.  
  939.  
  940.  
  941. end
  942. end)
Advertisement
Add Comment
Please, Sign In to add comment