• please can someone help my fix this code
    2 replies, posted
the weapon i tried to make simply dosen't show up in my game if CLIENT then SWEP.DrawWeaponInfoBox = false SWEP.BounceWeaponIcon = false end SWEP.PrintName = "bat" SWEP.Category = "Raxy's Melee" SWEP.ViewModel = "models/weapons/c_crowbar.mdl" SWEP.ViewModelFlip = false SWEP.UseHands = true SWEP.WorldModel = "models/weapons/w_crowbar.mdl" SWEP.SetHoldType = "melee2" SWEP.Weight = 5 SWEP.AutoSwitchTo = false SWEP.AutoSwitchFrom = false SWEP.DrawAmmo = false SWEP.DrawCrosshair = true SWEP.Base = "weapon_base" SWEP.Spawnable = true SWEP.AdminSpawnable = true SWEP.FiresUnderwater SWEP.Primary.ClipSize = -1 SWEP.Primary.DeafultClip = -1 SWEP.Primary.Ammo = "none" SWEP.Primary.Automatic = true SWEP.Primary.Damage = 5 SWEP.Primary.DealyMiss = 1 SWEP.Primary.DealyHit = 0.5 SWEP.Primary.Force = 100 SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DeafultClip = -1 SWEP.Secondary.Ammo = "none" SWEP.Secondary.Automatic = true function SWEP:Initialize() self:SetWeaponHoldType( self.HoldType ) end function SWEP:PrimaryAttack() self.Owner:EmitSound("Weapon_Bat.Miss") local tr = util.TraceLine( { start = self.Owner:GetShootPos(), endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * 64, msak = MASK_SHOT_HULL, } ) if !IsValid( tr.Entity ) then tr = util.TraceHull ( { start = self.Owner:GetShootPos(), endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * 64, mins = Vector( -25, -25 , -25 ), maxs = Vector( 25, 25 , 25 ), msak = MASK_SHOT_HULL, } ) end if SERVER and IsValid( tr.Entity ) then local dmginfo = DamageInfo() local attacker = self.Owner if !IsValid( attacker ) then attacker = self end if tr.Hit then if SERVER then if tr.Entity:IsPlayer() or tr.Entity:IsNPC() or tr.Entity.Type == "nextbot" or tr.Entity:GetClass() == "prop_ragdoll" then self.Owner:EmitSound("Bounce.Wood") end if !(tr.Entity:IsPlayer() or tr.Entity:IsNPC() or tr.Entity.Type == "nextbot" or tr.Entity:GetClass() == "prop_ragdoll" ) then self.Owner:EmitSound("Weapon_Bat.Miss") end end self:Weapon:SendWeaponAnim( ACT_VM_HITCENTER ) end self.Owner:SetAnimation ( PLAYER_ATTACK1 ) end end function SWEP:SecondaryAttack() end
oh god, atleast put it in facepunch code tags. It`s not great cause its a bit broken, but its ALOT better than just putting it in here with no Tabs...or use pastebin. Please. Something. anything. Just not pure text
Like Trackster said please put more effort into your posts if you expect us make an effort to help Descriptive title Tell us any errors you're getting if any Describe your expectations and what's not working as intended Put your code in tags
Sorry, you need to Log In to post a reply to this thread.