Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( SERVER ) then
- AddCSLuaFile( "shared.lua" )
- end
- if ( CLIENT ) then
- SWEP.PrintName = "Death's Scythe"
- SWEP.Author = "Tablo"
- SWEP.Category = "Taco SWEPS"
- SWEP.Slot = 0
- SWEP.SlotPos = 1
- SWEP.DrawAmmo = false
- SWEP.IconLetter = "w"
- killicon.AddFont( "weapon_crowbar", "HL2MPTypeDeath", "6", Color( 255, 80, 0, 255 ) )
- surface.CreateFont( "Taco_Text", {
- font = "Trebuchet24",
- size = 30,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false,
- } )
- surface.CreateFont( "Center_taco_text", {
- font = "Trebuchet24",
- size = 100,
- weight = 100,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false,
- } )
- end
- SWEP.Base = "weapon_base"
- SWEP.Spawnable = false
- SWEP.AdminSpawnable = false
- SWEP.AdminOnly = false
- SWEP.ViewModel = "models/tiggomods/weapons/DmC5/v_osiris.mdl"
- --SWEP.WorldModel = "models/tiggomods/weapons/DmC5/w_osiris.mdl"
- SWEP.DrawCrosshair = true
- SWEP.ViewModelFOV = 65
- SWEP.ViewModelFlip = false
- SWEP.Weight = 1
- SWEP.AutoSwitchTo = true
- SWEP.AutoSwitchFrom = false
- SWEP.CSMuzzleFlashes = false
- SWEP.Primary.Damage = 35
- SWEP.Primary.Force = 150
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.Delay = 1
- SWEP.Primary.DefaultClip = 1
- SWEP.Primary.Automatic = false
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Damage = 0
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.Grim_Reaper_Miss_Sound = Sound("weapons/grim_reaper/sycth_swing.wav")
- SWEP.Grim_Reaper_Wall_Sound = Sound("weapons/grim_reaper/sycth_hit_wall_1.wav")
- SWEP.Grim_Reaper_Non_Wall_Sound = Sound("weapons/grim_reaper/sycth_hit_wall_1.wav")
- local nextheartbeat = 0
- SWEP.Grim_Reaper_Intro = Sound("ambient/voices/playground_memory.wav")
- SWEP.ViewModelFlip = false
- SWEP.UseHands = false
- SWEP.WorldModel = "" --models/tiggomods/weapons/dmc5/w_osiris.mdl
- SWEP.ShowWorldModel = false
- SWEP.WElements = {
- ["reaperscythe"] = { type = "Model", model = "models/tiggomods/weapons/dmc5/w_osiris.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(3.635, 2.4, 0), angle = Angle(19.87, -3.507, 180), size = Vector(0.69, 0.69, 0.69), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
- }
- SWEP.Grim_Reaper_Slash_Distance = 140
- function SWEP:SetupDataTables()
- self:NetworkVar( "Float", 0, "NextMeleeAttack" )
- end
- function SWEP:PrimaryAttack()
- self.Owner:SetAnimation( PLAYER_ATTACK1 )
- self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
- if (hook.Run("CanPlayerSwingScyth", self.Owner) == false) then
- return
- end
- self:EmitSound( self.Grim_Reaper_Miss_Sound )
- self:SetNextMeleeAttack( CurTime() + 0.2 )
- self:SetNextPrimaryFire( CurTime() + 0.4 )
- end
- function SWEP:Grim_Reaper_Deal_Damage()
- self.Owner:LagCompensation( true )
- local tr = util.TraceLine( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Grim_Reaper_Slash_Distance,
- filter = self.Owner,
- mask = MASK_SHOT_HULL
- } )
- if ( !IsValid( tr.Entity ) ) then
- tr = util.TraceHull( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Grim_Reaper_Slash_Distance,
- filter = self.Owner,
- mins = Vector( -10, -10, -8 ),
- maxs = Vector( 10, 10, 8 ),
- mask = MASK_SHOT_HULL
- } )
- end
- -- We need the second part for single player because SWEP:Think is ran shared in SP
- if ( tr.HitWorld && !( game.SinglePlayer() && CLIENT ) ) then
- self:EmitSound( self.Grim_Reaper_Wall_Sound )
- elseif ( tr.HitNonWorld && !( game.SinglePlayer() && CLIENT ) ) then
- self:EmitSound( self.Grim_Reaper_Non_Wall_Sound )
- end
- if IsValid( tr.Entity ) then
- if ( tr.Entity:GetClass() == "func_breakable_surf" ) then
- local bullet = {}
- bullet.Num= 1
- bullet.Src = self.Owner:GetShootPos()
- bullet.Dir= self.Owner:GetAimVector()
- bullet.Spread = Vector(0,0,0)
- bullet.Tracer = 0
- bullet.Force = 1
- bullet.Damage = 0
- self.Owner:FireBullets(bullet)
- end
- end
- local hit = false
- if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsPlayer()) ) then
- local dmginfo = DamageInfo()
- local attacker = self.Owner
- if ( !IsValid( attacker ) ) then attacker = self end
- dmginfo:SetAttacker( attacker )
- dmginfo:SetInflictor( self )
- -- dmginfo:SetDamage( math.random( 65, 75 ) )
- if tr.Entity:Health() <= 30 and tr.Entity:IsPlayer() then
- dmginfo:SetDamage (9999999)
- self.Owner:SetHealth( math.Clamp( self.Owner:Health() + 10, 0, 220 ) )
- else
- dmginfo:SetDamage( 0 )
- self.Owner:SetHealth( math.Clamp( self.Owner:Health() - 15, 0, 220 ) )
- if self.Owner:Health() <= 0 then
- self.Owner:Kill()
- end
- end
- self:EmitSound( self.Grim_Reaper_Non_Wall_Sound )
- -- self.Owner:SetHealth( math.Clamp( self.Owner:Health() + 10, 0, 500 ) )
- tr.Entity:TakeDamageInfo( dmginfo )
- hit = true
- end
- if ( SERVER && IsValid( tr.Entity ) ) then
- local phys = tr.Entity:GetPhysicsObject()
- if ( IsValid( phys ) ) then
- phys:ApplyForceOffset( self.Owner:GetAimVector() * 80 * phys:GetMass(), tr.HitPos )
- end
- end
- self.Owner:LagCompensation( false )
- end
- function SWEP:Think()
- if CurTime() > nextheartbeat then
- nextheartbeat = CurTime() + 0.8
- for k,v in pairs( ents.GetAll() ) do
- if IsValid(v) then
- if v:IsPlayer() and v:Alive() and v:Health() <= 30 and v:Health() > 0 and v ~= self.Owner then
- if (ply:Team() != TEAM_DEADPOOL) or (ply:Team() != TEAM_LADY_DEADPOOL) then
- if CLIENT then
- self.Owner.emitter = ParticleEmitter( self.Owner:GetPos() )
- surface.PlaySound("weapons/grim_reaper/sycth_heart_beat.mp3")
- local heartbeat = self.Owner.emitter:Add( "sprites/light_glow02_add_noz", v:GetPos() + Vector(0,0,50) )
- heartbeat:SetDieTime( 0.5 )
- heartbeat:SetStartAlpha( 255 )
- heartbeat:SetEndAlpha( 0 )
- heartbeat:SetStartSize( 200 )
- heartbeat:SetEndSize( 0 )
- heartbeat:SetColor(255,0,0)
- end
- end
- end
- end
- end
- end
- local curtime = CurTime()
- local grim_reaper_scyth_time = self:GetNextMeleeAttack()
- if ( grim_reaper_scyth_time > 0 && CurTime() > grim_reaper_scyth_time ) then
- self:Grim_Reaper_Deal_Damage()
- self:SetNextMeleeAttack( 0 )
- end
- end
- function SWEP:SecondaryAttack()
- return false
- end
- function SWEP:DrawHUD()
- for k, v in pairs(player.GetAll()) do
- if (v != self.Owner and v:Health() <= 30 and v:Health() > 0 ) then
- if (ply:Team() != TEAM_DEADPOOL) or (ply:Team() != TEAM_LADY_DEADPOOL) then
- local position = v:LocalToWorld(v:OBBCenter() + Vector(0,0,50)):ToScreen()
- local x, y = position.x, position.y
- draw.DrawText("KILL...", "Taco_Text" , x, y, Color(255,255,255), TEXT_ALIGN_CENTER)
- end
- end
- end
- end
- --[[********************************************************
- SWEP Construction Kit base code
- Created by Clavus
- Available for public use, thread at:
- facepunch.com/threads/1032378
- DESCRIPTION:
- This script is meant for experienced scripters
- that KNOW WHAT THEY ARE DOING. Don't come to me
- with basic Lua questions.
- Just copy into your SWEP or SWEP base of choice
- and merge with your own code.
- The SWEP.VElements, SWEP.WElements and
- SWEP.ViewModelBoneMods tables are all optional
- and only have to be visible to the client.
- ********************************************************]]--
- function SWEP:Initialize()
- -- other initialize code goes here
- self:SetWeaponHoldType( "melee2" )
- self.Weapon:EmitSound( self.Grim_Reaper_Intro )
- if CLIENT then
- -- Create a new table for every weapon instance
- self.VElements = table.FullCopy( self.VElements )
- self.WElements = table.FullCopy( self.WElements )
- self.ViewModelBoneMods = table.FullCopy( self.ViewModelBoneMods )
- self:CreateModels(self.VElements) -- create viewmodels
- self:CreateModels(self.WElements) -- create worldmodels
- -- init view model bone build function
- if IsValid(self.Owner) then
- local vm = self.Owner:GetViewModel()
- if IsValid(vm) then
- self:ResetBonePositions(vm)
- -- Init viewmodel visibility
- if (self.ShowViewModel == nil or self.ShowViewModel) then
- vm:SetColor(Color(255,255,255,255))
- else
- -- we set the alpha to 1 instead of 0 because else ViewModelDrawn stops being called
- vm:SetColor(Color(255,255,255,1))
- -- ^ stopped working in GMod 13 because you have to do Entity:SetRenderMode(1) for translucency to kick in
- -- however for some reason the view model resets to render mode 0 every frame so we just apply a debug material to prevent it from drawing
- vm:SetMaterial("Debug/hsv")
- end
- end
- end
- end
- end
- function SWEP:Holster()
- if CLIENT and IsValid(self.Owner) then
- local vm = self.Owner:GetViewModel()
- if IsValid(vm) then
- self:ResetBonePositions(vm)
- end
- end
- if SERVER then
- self.Owner:SetColor( Color(255, 255, 255, 255) )
- self.Owner:SetMaterial( "" )
- self.Owner:DrawShadow(true)
- self.Owner:SetRunSpeed(255)
- self.Owner:SetJumpPower(200)
- -- self.Owner:GodDisable()
- end
- return true
- end
- function SWEP:Deploy()
- if SERVER then
- self.Owner:SetColor( Color(255, 255, 255, 0) )
- self.Owner:SetMaterial( "sprites/heatwave" )
- self.Owner:DrawShadow(false)
- self.Owner:SetRunSpeed(700)
- self.Owner:SetJumpPower(800)
- -- self.Owner:GodEnable()
- end
- return true
- end
- function SWEP:OnRemove()
- self:Holster()
- end
- if CLIENT then
- SWEP.vRenderOrder = nil
- function SWEP:ViewModelDrawn()
- local vm = self.Owner:GetViewModel()
- if !IsValid(vm) then return end
- if (!self.VElements) then return end
- self:UpdateBonePositions(vm)
- if (!self.vRenderOrder) then
- -- we build a render order because sprites need to be drawn after models
- self.vRenderOrder = {}
- for k, v in pairs( self.VElements ) do
- if (v.type == "Model") then
- table.insert(self.vRenderOrder, 1, k)
- elseif (v.type == "Sprite" or v.type == "Quad") then
- table.insert(self.vRenderOrder, k)
- end
- end
- end
- for k, name in ipairs( self.vRenderOrder ) do
- local v = self.VElements[name]
- if (!v) then self.vRenderOrder = nil break end
- if (v.hide) then continue end
- local model = v.modelEnt
- local sprite = v.spriteMaterial
- if (!v.bone) then continue end
- local pos, ang = self:GetBoneOrientation( self.VElements, v, vm )
- if (!pos) then continue end
- if (v.type == "Model" and IsValid(model)) then
- model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z )
- ang:RotateAroundAxis(ang:Up(), v.angle.y)
- ang:RotateAroundAxis(ang:Right(), v.angle.p)
- ang:RotateAroundAxis(ang:Forward(), v.angle.r)
- model:SetAngles(ang)
- --model:SetModelScale(v.size)
- local matrix = Matrix()
- matrix:Scale(v.size)
- model:EnableMatrix( "RenderMultiply", matrix )
- if (v.material == "") then
- model:SetMaterial("")
- elseif (model:GetMaterial() != v.material) then
- model:SetMaterial( v.material )
- end
- if (v.skin and v.skin != model:GetSkin()) then
- model:SetSkin(v.skin)
- end
- if (v.bodygroup) then
- for k, v in pairs( v.bodygroup ) do
- if (model:GetBodygroup(k) != v) then
- model:SetBodygroup(k, v)
- end
- end
- end
- if (v.surpresslightning) then
- render.SuppressEngineLighting(true)
- end
- render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255)
- render.SetBlend(v.color.a/255)
- model:DrawModel()
- render.SetBlend(1)
- render.SetColorModulation(1, 1, 1)
- if (v.surpresslightning) then
- render.SuppressEngineLighting(false)
- end
- elseif (v.type == "Sprite" and sprite) then
- local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
- render.SetMaterial(sprite)
- render.DrawSprite(drawpos, v.size.x, v.size.y, v.color)
- elseif (v.type == "Quad" and v.draw_func) then
- local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
- ang:RotateAroundAxis(ang:Up(), v.angle.y)
- ang:RotateAroundAxis(ang:Right(), v.angle.p)
- ang:RotateAroundAxis(ang:Forward(), v.angle.r)
- cam.Start3D2D(drawpos, ang, v.size)
- v.draw_func( self )
- cam.End3D2D()
- end
- end
- end
- SWEP.wRenderOrder = nil
- function SWEP:DrawWorldModel()
- if (self.ShowWorldModel == nil or self.ShowWorldModel) then
- self:DrawModel()
- end
- if (!self.WElements) then return end
- if (!self.wRenderOrder) then
- self.wRenderOrder = {}
- for k, v in pairs( self.WElements ) do
- if (v.type == "Model") then
- table.insert(self.wRenderOrder, 1, k)
- elseif (v.type == "Sprite" or v.type == "Quad") then
- table.insert(self.wRenderOrder, k)
- end
- end
- end
- if (IsValid(self.Owner)) then
- bone_ent = self.Owner
- else
- -- when the weapon is dropped
- bone_ent = self
- end
- for k, name in pairs( self.wRenderOrder ) do
- local v = self.WElements[name]
- if (!v) then self.wRenderOrder = nil break end
- if (v.hide) then continue end
- local pos, ang
- if (v.bone) then
- pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent )
- else
- pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent, "ValveBiped.Bip01_R_Hand" )
- end
- if (!pos) then continue end
- local model = v.modelEnt
- local sprite = v.spriteMaterial
- if (v.type == "Model" and IsValid(model)) then
- model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z )
- ang:RotateAroundAxis(ang:Up(), v.angle.y)
- ang:RotateAroundAxis(ang:Right(), v.angle.p)
- ang:RotateAroundAxis(ang:Forward(), v.angle.r)
- model:SetAngles(ang)
- --model:SetModelScale(v.size)
- local matrix = Matrix()
- matrix:Scale(v.size)
- model:EnableMatrix( "RenderMultiply", matrix )
- if (v.material == "") then
- model:SetMaterial("")
- elseif (model:GetMaterial() != v.material) then
- model:SetMaterial( v.material )
- end
- if (v.skin and v.skin != model:GetSkin()) then
- model:SetSkin(v.skin)
- end
- if (v.bodygroup) then
- for k, v in pairs( v.bodygroup ) do
- if (model:GetBodygroup(k) != v) then
- model:SetBodygroup(k, v)
- end
- end
- end
- if (v.surpresslightning) then
- render.SuppressEngineLighting(true)
- end
- render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255)
- render.SetBlend(v.color.a/255)
- model:DrawModel()
- render.SetBlend(1)
- render.SetColorModulation(1, 1, 1)
- if (v.surpresslightning) then
- render.SuppressEngineLighting(false)
- end
- elseif (v.type == "Sprite" and sprite) then
- local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
- render.SetMaterial(sprite)
- render.DrawSprite(drawpos, v.size.x, v.size.y, v.color)
- elseif (v.type == "Quad" and v.draw_func) then
- local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
- ang:RotateAroundAxis(ang:Up(), v.angle.y)
- ang:RotateAroundAxis(ang:Right(), v.angle.p)
- ang:RotateAroundAxis(ang:Forward(), v.angle.r)
- cam.Start3D2D(drawpos, ang, v.size)
- v.draw_func( self )
- cam.End3D2D()
- end
- end
- end
- function SWEP:GetBoneOrientation( basetab, tab, ent, bone_override )
- local bone, pos, ang
- if (tab.rel and tab.rel != "") then
- local v = basetab[tab.rel]
- if (!v) then return end
- -- Technically, if there exists an element with the same name as a bone
- -- you can get in an infinite loop. Let's just hope nobody's that stupid.
- pos, ang = self:GetBoneOrientation( basetab, v, ent )
- if (!pos) then return end
- pos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
- ang:RotateAroundAxis(ang:Up(), v.angle.y)
- ang:RotateAroundAxis(ang:Right(), v.angle.p)
- ang:RotateAroundAxis(ang:Forward(), v.angle.r)
- else
- bone = ent:LookupBone(bone_override or tab.bone)
- if (!bone) then return end
- pos, ang = Vector(0,0,0), Angle(0,0,0)
- local m = ent:GetBoneMatrix(bone)
- if (m) then
- pos, ang = m:GetTranslation(), m:GetAngles()
- end
- if (IsValid(self.Owner) and self.Owner:IsPlayer() and
- ent == self.Owner:GetViewModel() and self.ViewModelFlip) then
- ang.r = -ang.r -- Fixes mirrored models
- end
- end
- return pos, ang
- end
- function SWEP:CreateModels( tab )
- if (!tab) then return end
- -- Create the clientside models here because Garry says we can't do it in the render hook
- for k, v in pairs( tab ) do
- if (v.type == "Model" and v.model and v.model != "" and (!IsValid(v.modelEnt) or v.createdModel != v.model) and
- string.find(v.model, ".mdl") and file.Exists (v.model, "GAME") ) then
- v.modelEnt = ClientsideModel(v.model, RENDER_GROUP_VIEW_MODEL_OPAQUE)
- if (IsValid(v.modelEnt)) then
- v.modelEnt:SetPos(self:GetPos())
- v.modelEnt:SetAngles(self:GetAngles())
- v.modelEnt:SetParent(self)
- v.modelEnt:SetNoDraw(true)
- v.createdModel = v.model
- else
- v.modelEnt = nil
- end
- elseif (v.type == "Sprite" and v.sprite and v.sprite != "" and (!v.spriteMaterial or v.createdSprite != v.sprite)
- and file.Exists ("materials/"..v.sprite..".vmt", "GAME")) then
- local name = v.sprite.."-"
- local params = { ["$basetexture"] = v.sprite }
- -- make sure we create a unique name based on the selected options
- local tocheck = { "nocull", "additive", "vertexalpha", "vertexcolor", "ignorez" }
- for i, j in pairs( tocheck ) do
- if (v[j]) then
- params["$"..j] = 1
- name = name.."1"
- else
- name = name.."0"
- end
- end
- v.createdSprite = v.sprite
- v.spriteMaterial = CreateMaterial(name,"UnlitGeneric",params)
- end
- end
- end
- local allbones
- local hasGarryFixedBoneScalingYet = false
- function SWEP:UpdateBonePositions(vm)
- if self.ViewModelBoneMods then
- if (!vm:GetBoneCount()) then return end
- -- !! WORKAROUND !! --
- -- We need to check all model names :/
- local loopthrough = self.ViewModelBoneMods
- if (!hasGarryFixedBoneScalingYet) then
- allbones = {}
- for i=0, vm:GetBoneCount() do
- local bonename = vm:GetBoneName(i)
- if (self.ViewModelBoneMods[bonename]) then
- allbones[bonename] = self.ViewModelBoneMods[bonename]
- else
- allbones[bonename] = {
- scale = Vector(1,1,1),
- pos = Vector(0,0,0),
- angle = Angle(0,0,0)
- }
- end
- end
- loopthrough = allbones
- end
- -- !! ----------- !! --
- for k, v in pairs( loopthrough ) do
- local bone = vm:LookupBone(k)
- if (!bone) then continue end
- -- !! WORKAROUND !! --
- local s = Vector(v.scale.x,v.scale.y,v.scale.z)
- local p = Vector(v.pos.x,v.pos.y,v.pos.z)
- local ms = Vector(1,1,1)
- if (!hasGarryFixedBoneScalingYet) then
- local cur = vm:GetBoneParent(bone)
- while(cur >= 0) do
- local pscale = loopthrough[vm:GetBoneName(cur)].scale
- ms = ms * pscale
- cur = vm:GetBoneParent(cur)
- end
- end
- s = s * ms
- -- !! ----------- !! --
- if vm:GetManipulateBoneScale(bone) != s then
- vm:ManipulateBoneScale( bone, s )
- end
- if vm:GetManipulateBoneAngles(bone) != v.angle then
- vm:ManipulateBoneAngles( bone, v.angle )
- end
- if vm:GetManipulateBonePosition(bone) != p then
- vm:ManipulateBonePosition( bone, p )
- end
- end
- else
- self:ResetBonePositions(vm)
- end
- end
- function SWEP:ResetBonePositions(vm)
- if (!vm:GetBoneCount()) then return end
- for i=0, vm:GetBoneCount() do
- vm:ManipulateBoneScale( i, Vector(1, 1, 1) )
- vm:ManipulateBoneAngles( i, Angle(0, 0, 0) )
- vm:ManipulateBonePosition( i, Vector(0, 0, 0) )
- end
- end
- /**************************
- Global utility code
- **************************/
- -- Fully copies the table, meaning all tables inside this table are copied too and so on (normal table.Copy copies only their reference).
- -- Does not copy entities of course, only copies their reference.
- -- WARNING: do not use on tables that contain themselves somewhere down the line or you'll get an infinite loop
- function table.FullCopy( tab )
- if (!tab) then return nil end
- local res = {}
- for k, v in pairs( tab ) do
- if (type(v) == "table") then
- res[k] = table.FullCopy(v) -- recursion ho!
- elseif (type(v) == "Vector") then
- res[k] = Vector(v.x, v.y, v.z)
- elseif (type(v) == "Angle") then
- res[k] = Angle(v.p, v.y, v.r)
- else
- res[k] = v
- end
- end
- return res
- end
- end
- hook.Add( "canDropWeapon", "grim_reaper_sycth_drop", function( ply, wep )
- if wep:GetClass() == "grim_reaper_sycth" then
- return false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement