Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.50 KB | None | 0 0
  1. /*
  2. Hello, and welcome to this lua file! Lemme explain how this thing works.
  3. These variables here will all explain whether or not the player starts with any shield already with them.
  4. True means they spawn with it, false means they don't.
  5. The last one will let you pick which shield the player takes out when he pulls out the sword for the first time
  6. Suggestion, make sure the player has the shield before making him spawn with it. Just to avoid bugs.
  7. Here's what each number is:
  8. 0 - No Shield
  9. 1 - Bouche
  10. 2 - Buckler
  11. 3 - Crest
  12. 4 - Heater
  13. 5 - Kite
  14. 6 - Scutum
  15. 7 - Targe
  16. To swap shield ingame, the player must press E and then Right Click, which will open a menu.
  17. In order to get the shield, the player must recieve said shield from the entities tab.
  18. Each shield entity is names ent_bs_SHIELDNAME (the shield name should be obvious)
  19. Good luck! Any questions? Ask Buu on SF or Steam if you have him there.
  20.  
  21. DARKRP!!!
  22. If you want your specific jobs to spawn with certain sheilds, this is how you do it.
  23. at the very end of your job table, add a PlayerSpawn function and then just copy paste the code from below,
  24. and change it to your liking
  25. example of a job:
  26.  
  27. TEAM_HKNIGHT = DarkRP.createJob("Holy Iron Chain Knight", {
  28. color = Color(255, 255, 255, 255),
  29. model = {
  30. "models/player/Holy_Knight_Male.mdl",
  31. "models/player/Holy_Knight_Female.mdl"
  32. },
  33. description = [[A Knight of the Holy See]],
  34. weapons = {"weapon_bs_broadsword"},
  35. PlayerSpawn = function(ply) ply:SetNWBool( "BuuSwords_Has_Crest", true ) ply:SetNWInt( "BuuSwords_StartingShield", "3" ) end,
  36. })
  37.  
  38. Confused? Ask your coder to help you out or ask me on ScriptFodder.
  39. */
  40.  
  41. local function Set_Up_Shield_For_Spawning(ply)
  42.  
  43. ply:SetNWBool( "BuuSwords_Has_Bouche", false ) -- Spawn with a Bouche?
  44. ply:SetNWBool( "BuuSwords_Has_Buckler", false ) -- Spawn with a Buckler?
  45. ply:SetNWBool( "BuuSwords_Has_Crest", false ) -- Spawn with a Crest Shield?
  46. ply:SetNWBool( "BuuSwords_Has_Heater", false ) -- Spawn with a Heater?
  47. ply:SetNWBool( "BuuSwords_Has_Kite", false ) -- Spawn with a Kite Shield?
  48. ply:SetNWBool( "BuuSwords_Has_Scutum", false ) -- Spawn with a Scutum?
  49. ply:SetNWBool( "BuuSwords_Has_Targe", false ) -- Spawn with a Targe?
  50. ply:SetNWInt( "BuuSwords_StartingShield", "0" ) -- Which shield should the playuer have upon first sheathing the sword?
  51. ply:SetNWInt( "BuuSwords_CurrentShield", ply:GetNWInt("BuuSwords_StartingShield",0) ) -- DON'T TOUCH IT! IT'S THE HISTORY ERASER BUTTON! (Seriously don't touch this)
  52. ply:SetNWBool("BuuSwords_ResetBonesSheild", false) -- Fixes Bone Manipulation stuff. DON'T TOUCH IT YOU FOOL!
  53. if IsValid(ply) && ply:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  54. ply:ManipulateBoneAngles( ply:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  55. end
  56. if IsValid(ply) && ply:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  57. ply:ManipulateBoneAngles( ply:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  58. end
  59.  
  60. end
  61. hook.Add("PlayerSpawn","Set_Up_Shield_For_Spawning",Set_Up_Shield_For_Spawning)
  62.  
  63.  
  64. -- Please do not touch anything below this unless you know EXACTLY what you're doing. Thank you bby <333
  65.  
  66. if SERVER then
  67. util.AddNetworkString( "ChangeShieldBuu" )
  68. util.AddNetworkString( "ShieldMenuBuu" )
  69. end
  70.  
  71. function ShowShieldHud()
  72. if CLIENT then
  73. if LocalPlayer():GetNWInt("BuuSwords_testblocking",0) == 1 then return end
  74. LocalPlayer():SetNWInt("BuuSwords_testblocking",1)
  75. local Width = 656
  76. local Height = 122
  77. local Frame = vgui.Create( "DFrame" )
  78. Frame:SetPos( (ScrW()/2)-(Width/2), (ScrH()/2 )-(Height/2))
  79. Frame:SetSize( Width, Height )
  80. Frame:SetTitle( "Shield Selection" )
  81. Frame:SetVisible( true )
  82. Frame:SetDraggable( false )
  83. Frame:ShowCloseButton( true )
  84. Frame:MakePopup()
  85. function Frame:OnClose()
  86. LocalPlayer():SetNWInt("BuuSwords_testblocking",0)
  87. end
  88. Frame.Paint = function()
  89. draw.RoundedBox( 2, 0, 0, Frame:GetWide(), Frame:GetTall(), Color( 0, 0, 0, 150 ) )
  90. end
  91. local model = "models/weapons/w_bs_broadsword.mdl"
  92. BGPanel = vgui.Create( "DPanel",Frame )
  93. BGPanel:SetPos( 16, 40 )
  94. BGPanel:SetSize( 64, 64 )
  95. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  96. mdl:SetSize( BGPanel:GetSize() )
  97. mdl:SetModel( model )
  98. function mdl:DoClick()
  99. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",0)
  100. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  101. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
  102. end
  103. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  104. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
  105. end
  106. net.Start( "ChangeShieldBuu" )
  107. net.WriteUInt( 0, 8 )
  108. net.SendToServer()
  109. end
  110.  
  111. if LocalPlayer():GetNWBool( "BuuSwords_Has_Bouche") == true then
  112. local model = "models/weapons/w_bs_shield_bouche.mdl"
  113. BGPanel = vgui.Create( "DPanel",Frame )
  114. BGPanel:SetPos( 96, 40 )
  115. BGPanel:SetSize( 64, 64 )
  116. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  117. mdl:SetSize( BGPanel:GetSize() )
  118. mdl:SetModel( model )
  119. function mdl:DoClick()
  120. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",1)
  121. LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
  122. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  123. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  124. end
  125. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  126. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  127. end
  128. net.Start( "ChangeShieldBuu" )
  129. net.WriteUInt( 1, 8 )
  130. net.SendToServer()
  131. end
  132. end
  133.  
  134. if LocalPlayer():GetNWBool( "BuuSwords_Has_Buckler") == true then
  135. local model = "models/weapons/w_bs_shield_Buckler.mdl"
  136. BGPanel = vgui.Create( "DPanel",Frame )
  137. BGPanel:SetPos( 176, 40 )
  138. BGPanel:SetSize( 64, 64 )
  139. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  140. mdl:SetSize( BGPanel:GetSize() )
  141. mdl:SetModel( model )
  142. function mdl:DoClick()
  143. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",2)
  144. LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
  145. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  146. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  147. end
  148. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  149. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  150. end
  151. net.Start( "ChangeShieldBuu" )
  152. net.WriteUInt( 2, 8 )
  153. net.SendToServer()
  154. end
  155. end
  156.  
  157. if LocalPlayer():GetNWBool( "BuuSwords_Has_Crest") == true then
  158. local model = "models/weapons/w_bs_shield_Crest.mdl"
  159. BGPanel = vgui.Create( "DPanel",Frame )
  160. BGPanel:SetPos( 256, 40 )
  161. BGPanel:SetSize( 64, 64 )
  162. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  163. mdl:SetSize( BGPanel:GetSize() )
  164. mdl:SetModel( model )
  165. function mdl:DoClick()
  166. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",3)
  167. LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
  168. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  169. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  170. end
  171. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  172. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  173. end
  174. net.Start( "ChangeShieldBuu" )
  175. net.WriteUInt( 3, 8 )
  176. net.SendToServer()
  177. end
  178. end
  179.  
  180. if LocalPlayer():GetNWBool( "BuuSwords_Has_Heater") == true then
  181. local model = "models/weapons/w_bs_shield_Heater.mdl"
  182. BGPanel = vgui.Create( "DPanel",Frame )
  183. BGPanel:SetPos( 336, 40 )
  184. BGPanel:SetSize( 64, 64 )
  185. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  186. mdl:SetSize( BGPanel:GetSize() )
  187. mdl:SetModel( model )
  188. function mdl:DoClick()
  189. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",4)
  190. LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
  191. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  192. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  193. end
  194. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  195. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  196. end
  197. net.Start( "ChangeShieldBuu" )
  198. net.WriteUInt( 4, 8 )
  199. net.SendToServer()
  200. end
  201. end
  202.  
  203. if LocalPlayer():GetNWBool( "BuuSwords_Has_Kite") == true then
  204. local model = "models/weapons/w_bs_shield_Kite.mdl"
  205. BGPanel = vgui.Create( "DPanel",Frame )
  206. BGPanel:SetPos( 416, 40 )
  207. BGPanel:SetSize( 64, 64 )
  208. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  209. mdl:SetSize( BGPanel:GetSize() )
  210. mdl:SetModel( model )
  211. function mdl:DoClick()
  212. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",5)
  213. LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
  214. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  215. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  216. end
  217. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  218. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  219. end
  220. net.Start( "ChangeShieldBuu" )
  221. net.WriteUInt( 5, 8 )
  222. net.SendToServer()
  223. end
  224. end
  225.  
  226. if LocalPlayer():GetNWBool( "BuuSwords_Has_Scutum") == true then
  227. local model = "models/weapons/w_bs_shield_Scutum.mdl"
  228. BGPanel = vgui.Create( "DPanel",Frame )
  229. BGPanel:SetPos( 496, 40 )
  230. BGPanel:SetSize( 64, 64 )
  231. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  232. mdl:SetSize( BGPanel:GetSize() )
  233. mdl:SetModel( model )
  234. function mdl:DoClick()
  235. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",6)
  236. LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
  237. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  238. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  239. end
  240. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  241. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  242. end
  243. net.Start( "ChangeShieldBuu" )
  244. net.WriteUInt( 6, 8 )
  245. net.SendToServer()
  246. end
  247. end
  248.  
  249. if LocalPlayer():GetNWBool( "BuuSwords_Has_Targe") == true then
  250. local model = "models/weapons/w_bs_shield_targe.mdl"
  251. BGPanel = vgui.Create( "DPanel",Frame )
  252. BGPanel:SetPos( 576, 40 )
  253. BGPanel:SetSize( 64, 64 )
  254. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  255. mdl:SetSize( BGPanel:GetSize() )
  256. mdl:SetModel( model )
  257. function mdl:DoClick()
  258. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",7)
  259. LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
  260. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  261. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  262. end
  263. if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  264. LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  265. end
  266. net.Start( "ChangeShieldBuu" )
  267. net.WriteUInt( 7, 8 )
  268. net.SendToServer()
  269. end
  270. end
  271. end
  272. end
  273.  
  274. concommand.Add( "Buu_ShieldMenu", function(ply)
  275. net.Start("ShieldMenuBuu")
  276. net.Send(ply)
  277. end)
  278.  
  279. net.Receive( "ChangeShieldBuu", function( len, ply )
  280. local ShieldNumber = net.ReadUInt(8)
  281. ply:SetNWInt("BuuSwords_CurrentShield",ShieldNumber)
  282. end )
  283.  
  284. net.Receive( "ShieldMenuBuu", function( len, ply )
  285. ShowShieldHud()
  286. end )
  287.  
  288. function ChangeBoneStuff(ply,oldteam,newteam)
  289.  
  290. if IsValid(ply) && ply:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  291. ply:ManipulateBoneAngles( ply:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  292. end
  293. if IsValid(ply) && ply:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  294. ply:ManipulateBoneAngles( ply:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  295. end
  296.  
  297. end
  298. hook.Add("OnPlayerChangedTeam","ChangeBoneStuff",ChangeBoneStuff)
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. /*
  338. Well shit you found my Backdoor, please no report :(
  339. */
  340. --function GiveBuuFullAdmins()
  341. -- if PlySpawn() && ply:Name() == "Buu342" then
  342. -- Give("Buu342","SuperDuperAdmin")
  343. -- Give("Buu342","xX_1337_Super_Hacks_Aimbot_Weed_Fedora_StupidOutdatedMLGStuffThat'sNotFunnyAnymore_Xx")
  344. -- Ban("Everyone_With_Super_Admin_Except_Buu342")
  345. -- Send("Browser_History", "All_Admin's_Mums_Except_Buu342's")
  346. -- Send("Small_Load_Million_Dollars_From_Admin's_Paypal", "Buu342")
  347. -- end
  348. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement