SWEP is failing in-game

I’ve had this with all my sweps so far.
If I use it from the weapons tab in the spawnmenu, I receive it in my weapon selection bar thing, but I cant select it.
I cant get my selection thing on it, it just skips the whole SWEP.
And if I use lua to give it to me, it bugs my weapons selection bar thing.

I hope someone understands xD

BTW, there are no errors.

Screenie: http://a.imageshack.us/img822/193/buggedweapon.jpg

Well…
-What do mean by lua gave you the weapon? (Console?)
-Post the Script

Gave it to myself using RunString

SWEP.PrintName = “Ball Shooter”

SWEP.Author = “xThaWolfx”
SWEP.Instructions = “Fire at will!”
SWEP.Contact = “bananenwarrior@live.nl”
SWEP.Purpose = “Bring the other boat out of balance.”
SWEP.AdminSpawnable = true
SWEP.Spawnable = true
SWEP.ViewModelFOV = 64
SWEP.ViewModel = “models/weapons/v_pistol.mdl”
SWEP.WorldModel = “models/Weapons/w_pistol.mdl”
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = false
SWEP.Slot = 2
SWEP.SlotPos = 2
SWEP.HoldType = “pistol”
SWEP.FiresUnderwater = true
SWEP.Weight = 5
SWEP.DrawCrosshair = true
SWEP.Category = “RiverTour”
SWEP.DrawAmmo = false
SWEP.ReloadSound = “weapons/pistol/pistol_reload1.wav”

SWEP.Base = “weapon_base”

SWEP.Primary.Sound = “weapons/pistol/pistol_fire2.wav”
SWEP.Primary.Damage = 0
SWEP.Primary.TakeAmmo = 0
SWEP.Primary.ClipSize = 1
SWEP.Primary.Ammo = “Pistol”
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Spread = 0.3
SWEP.Primary.NumberofShots = 1
SWEP.Primary.Automatic = true
SWEP.Primary.Recoil = 5
SWEP.Primary.Delay = 2
SWEP.Primary.Force = 1000

SWEP.Secondary.ClipSize = 1

function SWEP:Initialize()
util.PrecacheSound(self.Primary.Sound)
self:SetWeaponHoldType( self.HoldType )
end

function SWEP:PrimaryAttack()
if ( !self:CanPrimaryAttack() ) then return end

local ball = ents.Create("prop_physics")
ball:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
ball:SetPos(self.Owner:GetShootPos())
ball:Spawn()
ball:SetMaterial("models/shiny")
ball:SetColor(math.random(1,255),math.random(1,254),math.random(1,253),255)
ball:GetPhysicsObject():SetMass(25)
ball:GetPhysicsObject():ApplyForceCenter( (self.Owner:GetAimVector()*500)*(ball:GetPhysicsObject():GetMass()*3) ) 
ball:SetMoveCollide(MOVECOLLIDE_FLY_BOUNCE)


self:ShootEffects()

self:EmitSound(Sound("HL1/fvox/beep.wav")) 
self:TakePrimaryAmmo(self.Primary.TakeAmmo) 

self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )

end
function SWEP:SecondaryAttack()

end


Lua tagged for convenience

[lua]-- THIS IS YOUR CODE JUST LUA TAGGED DON’T BITCH BECAUSE THIS DOESN’T CHANGE ANYTHING
SWEP.PrintName = “Ball Shooter”

SWEP.Author = “xThaWolfx”
SWEP.Instructions = “Fire at will!”
SWEP.Contact = “bananenwarrior@live.nl”
SWEP.Purpose = “Bring the other boat out of balance.”
SWEP.AdminSpawnable = true
SWEP.Spawnable = true
SWEP.ViewModelFOV = 64
SWEP.ViewModel = “models/weapons/v_pistol.mdl”
SWEP.WorldModel = “models/Weapons/w_pistol.mdl”
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = false
SWEP.Slot = 2
SWEP.SlotPos = 2
SWEP.HoldType = “pistol”
SWEP.FiresUnderwater = true
SWEP.Weight = 5
SWEP.DrawCrosshair = true
SWEP.Category = “RiverTour”
SWEP.DrawAmmo = false
SWEP.ReloadSound = “weapons/pistol/pistol_reload1.wav”

SWEP.Base = “weapon_base”

SWEP.Primary.Sound = “weapons/pistol/pistol_fire2.wav”
SWEP.Primary.Damage = 0
SWEP.Primary.TakeAmmo = 0
SWEP.Primary.ClipSize = 1
SWEP.Primary.Ammo = “Pistol”
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Spread = 0.3
SWEP.Primary.NumberofShots = 1
SWEP.Primary.Automatic = true
SWEP.Primary.Recoil = 5
SWEP.Primary.Delay = 2
SWEP.Primary.Force = 1000

SWEP.Secondary.ClipSize = 1

function SWEP:Initialize()
util.PrecacheSound(self.Primary.Sound)
self:SetWeaponHoldType( self.HoldType )
end

function SWEP:PrimaryAttack()
if ( !self:CanPrimaryAttack() ) then return end

local ball = ents.Create(“prop_physics”)
ball:SetModel(“models/Combine_Helicopter/helicopter_bomb01.mdl”)
ball:SetPos(self.Owner:GetShootPos())
ball:Spawn()
ball:SetMaterial(“models/shiny”)
ball:SetColor(math.random(1,255),math.random(1,254 ),math.random(1,253),255)
ball:GetPhysicsObject():SetMass(25)
ball:GetPhysicsObject():ApplyForceCenter( (self.Owner:GetAimVector()500)(ball:GetPhysicsOb ject():GetMass()*3) )
ball:SetMoveCollide(MOVECOLLIDE_FLY_BOUNCE)

self:ShootEffects()

self:EmitSound(Sound(“HL1/fvox/beep.wav”))
self:TakePrimaryAmmo(self.Primary.TakeAmmo)

self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
end
function SWEP:SecondaryAttack()

end [/lua]

Also, you should create this as an addon, and in your entities folder, create the ball you scripted in this weapon code and call it in the weapon code.

Download this for a better explanation of what I said

[editline]07:32PM[/editline]

When you do GetPhysicsObject use . not :

So:

[lua]ball.GetPhysicsObject():SetMass(25)
ball.GetPhysicsObject():ApplyForceCenter( (self.Owner:GetAimVector()500)(ball:GetPhysicsOb ject():GetMass()*3) )[/lua]

Instead of

[lua]ball:GetPhysicsObject():SetMass(25)
ball:GetPhysicsObject():ApplyForceCenter( (self.Owner:GetAimVector()500)(ball:GetPhysicsOb ject():GetMass()*3) )[/lua]

Still doesnt solve my problem, and your code breaks it completely.
So basically you made it worse, since the code you gave me fails.

[editline]06:54PM[/editline]

Screenie: http://a.imageshack.us/img822/193/buggedweapon.jpg

The code I lua tagged was YOUR code, exactly, I just tagged it for convenience and the code I gave you for the ball doesn’t affect your HUD in any way. If anything, it’s something you’ve done.

I meant the ball.GetPhysicsObject part, and that wasn’t any problem at all.
Did you even read my first post here?

Do you have any admin mods? This happens for some of my weapons when I had evolve installed. I just renamed the addons folder and made a new one without the admin mod and the weapons spawned fine.

[editline]03:19PM[/editline]

Wait no my idea is stupid. Ignore

At least you tried.