• Is this right?
    1 replies, posted
I'm trying to make a swep that multiplies damage by half of your current velocity. Is this how I'd do it? I would test it myself but I'm on the toilet at school :/ SWEP.Category                 = "Smash" SWEP.PrintName                = "Force Crowbar"             SWEP.Author                    = Bitl, Chroma" SWEP.Instructions            = "Surf to gain momentum, bhop to keep momentum, and swing to deal damage multiplied by momentum" SWEP.Spawnable                 = true SWEP.AdminOnly                 = false SWEP.Primary.ClipSize        = -1 SWEP.Primary.DefaultClip    = -1 SWEP.Primary.Automatic        = true SWEP.Primary.Ammo            = "None" SWEP.Secondary.ClipSize        = -1 SWEP.Secondary.DefaultClip    = -1 SWEP.Secondary.Automatic    = false SWEP.Secondary.Ammo            = "None" SWEP.Weight                    = 3 SWEP.AutoSwitchTo            = false SWEP.AutoSwitchFrom            = false SWEP.Slot                    = 0 SWEP.SlotPos                = 4 SWEP.DrawAmmo                = false SWEP.DrawCrosshair            = true SWEP.ViewModel                = "models/weapons/v_crowbar.mdl" SWEP.WorldModel                = "models/weapons/w_crowbar.mdl" function SWEP:Initialize()     self:SetWeaponHoldType( "melee" ) end function SWEP:PrimaryAttack()          self.Weapon:SetNextPrimaryFire( CurTime() + 0.5 )           local trace = self.Owner:GetEyeTrace();     if trace.HitPos:Distance(self.Owner:GetShootPos()) <= 75 then             self.Owner:SetAnimation( PLAYER_ATTACK1 );             self.Weapon:SendWeaponAnim( ACT_VM_HITCENTER );                 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  = self.Owner:GetVelocity()                 bullet.Damage = 25 + self.OwnerVelocity()             self.Owner:FireBullets(bullet)             self.Weapon:EmitSound("Weapon_Crowbar.Melee_Hit")                 else         self.Owner:SetAnimation( PLAYER_ATTACK1 );         self.Weapon:SendWeaponAnim( ACT_VM_HITCENTER );         self.Weapon:EmitSound("Weapon_Crowbar.Single")     end          self.Weapon:SetNextPrimaryFire( CurTime() + 0.43 ) I wouldve used Bitl's base. (wouldve just used my own base, but a gain I'm at school.)
In your self.Owner:GetVelocity() add Vector/Length to just get the length and not a vector, so you get a plain velocity, then you subtract it by 4 and you got it
Sorry, you need to Log In to post a reply to this thread.