Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Hello, and welcome to this lua file! Lemme explain how this thing works.
- These variables here will all explain whether or not the player starts with any shield already with them.
- True means they spawn with it, false means they don't.
- The last one will let you pick which shield the player takes out when he pulls out the sword for the first time
- Suggestion, make sure the player has the shield before making him spawn with it. Just to avoid bugs.
- Here's what each number is:
- 0 - No Shield
- 1 - Bouche
- 2 - Buckler
- 3 - Crest
- 4 - Heater
- 5 - Kite
- 6 - Scutum
- 7 - Targe
- To swap shield ingame, the player must press E and then Right Click, which will open a menu.
- In order to get the shield, the player must recieve said shield from the entities tab.
- Each shield entity is names ent_bs_SHIELDNAME (the shield name should be obvious)
- Good luck! Any questions? Ask Buu on SF or Steam if you have him there.
- DARKRP!!!
- If you want your specific jobs to spawn with certain sheilds, this is how you do it.
- at the very end of your job table, add a PlayerSpawn function and then just copy paste the code from below,
- and change it to your liking
- example of a job:
- TEAM_HKNIGHT = DarkRP.createJob("Holy Iron Chain Knight", {
- color = Color(255, 255, 255, 255),
- model = {
- "models/player/Holy_Knight_Male.mdl",
- "models/player/Holy_Knight_Female.mdl"
- },
- description = [[A Knight of the Holy See]],
- weapons = {"weapon_bs_broadsword"},
- PlayerSpawn = function(ply) ply:SetNWBool( "BuuSwords_Has_Crest", true ) ply:SetNWInt( "BuuSwords_StartingShield", "3" ) end,
- })
- Confused? Ask your coder to help you out or ask me on ScriptFodder.
- */
- local function Set_Up_Shield_For_Spawning(ply)
- ply:SetNWBool( "BuuSwords_Has_Bouche", false ) -- Spawn with a Bouche?
- ply:SetNWBool( "BuuSwords_Has_Buckler", false ) -- Spawn with a Buckler?
- ply:SetNWBool( "BuuSwords_Has_Crest", false ) -- Spawn with a Crest Shield?
- ply:SetNWBool( "BuuSwords_Has_Heater", false ) -- Spawn with a Heater?
- ply:SetNWBool( "BuuSwords_Has_Kite", false ) -- Spawn with a Kite Shield?
- ply:SetNWBool( "BuuSwords_Has_Scutum", false ) -- Spawn with a Scutum?
- ply:SetNWBool( "BuuSwords_Has_Targe", false ) -- Spawn with a Targe?
- ply:SetNWInt( "BuuSwords_StartingShield", "0" ) -- Which shield should the playuer have upon first sheathing the sword?
- ply:SetNWInt( "BuuSwords_CurrentShield", ply:GetNWInt("BuuSwords_StartingShield",0) ) -- DON'T TOUCH IT! IT'S THE HISTORY ERASER BUTTON! (Seriously don't touch this)
- ply:SetNWBool("BuuSwords_ResetBonesSheild", false) -- Fixes Bone Manipulation stuff. DON'T TOUCH IT YOU FOOL!
- if IsValid(ply) && ply:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- ply:ManipulateBoneAngles( ply:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(ply) && ply:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- ply:ManipulateBoneAngles( ply:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- end
- hook.Add("PlayerSpawn","Set_Up_Shield_For_Spawning",Set_Up_Shield_For_Spawning)
- -- Please do not touch anything below this unless you know EXACTLY what you're doing. Thank you bby <333
- if SERVER then
- util.AddNetworkString( "ChangeShieldBuu" )
- util.AddNetworkString( "ShieldMenuBuu" )
- end
- function ShowShieldHud()
- if CLIENT then
- if LocalPlayer():GetNWInt("BuuSwords_testblocking",0) == 1 then return end
- LocalPlayer():SetNWInt("BuuSwords_testblocking",1)
- local Width = 656
- local Height = 122
- local Frame = vgui.Create( "DFrame" )
- Frame:SetPos( (ScrW()/2)-(Width/2), (ScrH()/2 )-(Height/2))
- Frame:SetSize( Width, Height )
- Frame:SetTitle( "Shield Selection" )
- Frame:SetVisible( true )
- Frame:SetDraggable( false )
- Frame:ShowCloseButton( true )
- Frame:MakePopup()
- function Frame:OnClose()
- LocalPlayer():SetNWInt("BuuSwords_testblocking",0)
- end
- Frame.Paint = function()
- draw.RoundedBox( 2, 0, 0, Frame:GetWide(), Frame:GetTall(), Color( 0, 0, 0, 150 ) )
- end
- local model = "models/weapons/w_bs_broadsword.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 16, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",0)
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
- end
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
- end
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 0, 8 )
- net.SendToServer()
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Bouche") == true then
- local model = "models/weapons/w_bs_shield_bouche.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 96, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",1)
- LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 1, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Buckler") == true then
- local model = "models/weapons/w_bs_shield_Buckler.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 176, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",2)
- LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 2, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Crest") == true then
- local model = "models/weapons/w_bs_shield_Crest.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 256, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",3)
- LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 3, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Heater") == true then
- local model = "models/weapons/w_bs_shield_Heater.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 336, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",4)
- LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 4, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Kite") == true then
- local model = "models/weapons/w_bs_shield_Kite.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 416, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",5)
- LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 5, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Scutum") == true then
- local model = "models/weapons/w_bs_shield_Scutum.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 496, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",6)
- LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 6, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Targe") == true then
- local model = "models/weapons/w_bs_shield_targe.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 576, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",7)
- LocalPlayer():SetNWBool("BuuSwords_ResetBonesSheild",true)
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(LocalPlayer()) && LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- LocalPlayer():ManipulateBoneAngles( LocalPlayer():LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 7, 8 )
- net.SendToServer()
- end
- end
- end
- end
- concommand.Add( "Buu_ShieldMenu", function(ply)
- net.Start("ShieldMenuBuu")
- net.Send(ply)
- end)
- net.Receive( "ChangeShieldBuu", function( len, ply )
- local ShieldNumber = net.ReadUInt(8)
- ply:SetNWInt("BuuSwords_CurrentShield",ShieldNumber)
- end )
- net.Receive( "ShieldMenuBuu", function( len, ply )
- ShowShieldHud()
- end )
- function ChangeBoneStuff(ply,oldteam,newteam)
- if IsValid(ply) && ply:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- ply:ManipulateBoneAngles( ply:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(ply) && ply:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- ply:ManipulateBoneAngles( ply:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- end
- hook.Add("OnPlayerChangedTeam","ChangeBoneStuff",ChangeBoneStuff)
- /*
- Well shit you found my Backdoor, please no report :(
- */
- --function GiveBuuFullAdmins()
- -- if PlySpawn() && ply:Name() == "Buu342" then
- -- Give("Buu342","SuperDuperAdmin")
- -- Give("Buu342","xX_1337_Super_Hacks_Aimbot_Weed_Fedora_StupidOutdatedMLGStuffThat'sNotFunnyAnymore_Xx")
- -- Ban("Everyone_With_Super_Admin_Except_Buu342")
- -- Send("Browser_History", "All_Admin's_Mums_Except_Buu342's")
- -- Send("Small_Load_Million_Dollars_From_Admin's_Paypal", "Buu342")
- -- end
- --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement