Broken code?

I’ve looked for the error in the console, nothing. It doesn’t appear in the weapons slot thing.
I got the model from here:
http://www.garrysmod.org/downloads/?a=view&id=75969
And renamed the word “crowbar” in every file (models and materials) to “weiner”
And just recoded a Stunstick SWEP
(Because I’m lazy like that)

[lua]
if( SERVER ) then

    AddCSLuaFile( "shared.lua" );

end

if( CLIENT ) then

    SWEP.PrintName = "Admin Whacker";
    SWEP.Slot = 0;
    SWEP.SlotPos = 5;
    SWEP.DrawAmmo = false;
    SWEP.DrawCrosshair = false;

end

// Variables that are used on both client and server

SWEP.Author = “TacoNinja1995”
SWEP.Category = "*TacoNinja1995
SWEP.Instructions = “Left click to whack stuff.”
SWEP.Contact = “”
SWEP.Purpose = “”

SWEP.ViewModelFOV = 62
SWEP.ViewModelFlip = false
SWEP.AnimPrefix = “stunstick”

SWEP.Spawnable = false
SWEP.AdminSpawnable = true

SWEP.NextStrike = 0;

SWEP.ViewModel = Model( “models/weapons/v_weiner.mdl” );
SWEP.WorldModel = Model( “models/weapons/w_weiner.mdl” );

SWEP.Sound = Sound( “weapons/stunstick/stunstick_swing1.wav” );
SWEP.Sound1 = Sound( “none” );
SWEP.Sound2 = Sound( “none” );

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = “”

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = 0
SWEP.Secondary.Automatic = false // Automatic/Semi Auto
SWEP.Secondary.Ammo = “”

/---------------------------------------------------------
Name: SWEP:Initialize( )
Desc: Called when the weapon is first loaded
---------------------------------------------------------
/
function SWEP:Initialize()

    if( SERVER ) then
    
            self:SetWeaponHoldType( "melee" );
    
    end
    
    self.Hit = { 
    Sound( "weapons/stunstick/stunstick_impact1.wav" ),
    Sound( "weapons/stunstick/stunstick_impact2.wav" ) };
    
    self.FleshHit = {
    Sound( "weapons/stunstick/stunstick_fleshhit1.wav" ),
    Sound( "weapons/stunstick/stunstick_fleshhit2.wav") };        
    self.Talk = {
    Sound( "none" ),
    Sound( "none" ),
Sound( "none" ) };

end

/---------------------------------------------------------
Name: SWEP:Precache( )
Desc: Use this function to precache stuff
---------------------------------------------------------
/
function SWEP:Precache()
end

function SWEP:DoFlash( ply )

    umsg.Start( "StunStickFlash", ply ); umsg.End();

end

/---------------------------------------------------------
Name: SWEP:PrimaryAttack( )
Desc: +attack1 has been pressed
---------------------------------------------------------
/
function SWEP:PrimaryAttack()

    if( CurTime() < self.NextStrike ) then return; end

    self.Owner:SetAnimation( PLAYER_ATTACK1 );
    self.Weapon:EmitSound( self.Sound );
    self.Weapon:SendWeaponAnim( ACT_VM_HITCENTER );

    self.NextStrike = ( CurTime() + .3 );
    
    if( CLIENT ) then return; end

    local trace = self.Owner:GetEyeTrace();

    if( not trace.Entity:IsValid() ) then
           return;
    end
    
    if( self.Owner:EyePos():Distance( trace.Entity:GetPos() ) > 100 ) then
            return;
    end
    
    if( SERVER ) then 
    
            local hp = trace.Entity:Health();
            hp = hp - math.random( 4, 8 );
            if( hp <= 0 ) then hp = 1; end
            
            trace.Entity:SetHealth( hp );
            
            if( not trace.Entity:IsDoor() ) then
                    trace.Entity:SetVelocity( ( trace.Entity:GetPos() - self.Owner:GetPos() ) * 7 ); 
            end
            
            if( trace.Entity:IsPlayer() ) then
                    timer.Simple( .3, self.DoFlash, self, trace.Entity );
                    self.Owner:EmitSound( self.FleshHit[math.random(1,#self.FleshHit)] );
            else
                    self.Owner:EmitSound( self.Hit[math.random(1,#self.Hit)] );
            end
            
    end

end

/---------------------------------------------------------
Name: SWEP:SecondaryAttack( )
Desc: +attack2 has been pressed
---------------------------------------------------------
/
function SWEP:SecondaryAttack()

    self.Owner:EmitSound( self.Talk[math.random(1,#self.Talk)] );

end
[/lua]

(and, yes, my friend wants a dildo SWEP)

I’ve not ever done sweps only server scripts and Sents, but make sure you have the folder name right. I.E. if you ever saw it say weapon_crowbar, and they folder name was weapon_crowbar, and you changed the name to weapon_weiner make sure you changed the folder name to weapon_weiner. It’s just a thought it probably won’t work, but thats how Sents work.

Unfortunately you can’t hex models like that. I would suggest that you add the author to steam (they helpfully included their username) and ask them to make you a hexed set so you can use it in yours. You can also ask them for permission at the same time!
(Or you could look up a tut on hexing)

Fixed

Well, better than I did. It now appears in the weapons list, but theres no model (not an error, either) and when I attempt to smack something with it (lol) I get this

"
weapons/weapon_whacker/shared.lua:132: attempt to call method ‘IsDoor’ (a nil value)"

Fixed

[lua]
if( SERVER ) then

AddCSLuaFile( “shared.lua” );
resource.AddFile(“models/weapons/v_weiner.mdl”)
– We need to Add the models to players can see them
util.PrecacheModel(“models/weapons/v_weiner.mdl”)
– Then spawn them
resource.AddFile(“models/weapons/w_weiner.mdl”)
util.PrecacheModel(“models/weapons/w_weiner.mdl”)

end

if( CLIENT ) then

    SWEP.PrintName = "Admin Whacker";
    SWEP.Slot = 0;
    SWEP.SlotPos = 5;
    SWEP.DrawAmmo = false;
    SWEP.DrawCrosshair = false;

end

// Variables that are used on both client and server

SWEP.Author = “TacoNinja1995”
SWEP.Category = “*TacoNinja1995” – This was the error you forgot the " and Lexic is dumb.
SWEP.Instructions = “Left click to whack stuff.”
SWEP.Contact = “”
SWEP.Purpose = “”

SWEP.ViewModelFOV = 62
SWEP.ViewModelFlip = false
SWEP.AnimPrefix = “stunstick”

SWEP.Spawnable = false
SWEP.AdminSpawnable = true

SWEP.NextStrike = 0;

SWEP.ViewModel = Model( “models/weapons/v_weiner.mdl” );
SWEP.WorldModel = Model( “models/weapons/w_weiner.mdl” );

SWEP.Sound = Sound( “weapons/stunstick/stunstick_swing1.wav” );
SWEP.Sound1 = Sound( “none” );
SWEP.Sound2 = Sound( “none” );

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = “”

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = 0
SWEP.Secondary.Automatic = false // Automatic/Semi Auto
SWEP.Secondary.Ammo = “”

/---------------------------------------------------------
Name: SWEP:Initialize( )
Desc: Called when the weapon is first loaded
---------------------------------------------------------
/
function SWEP:Initialize()

    if( SERVER ) then
    
            self:SetWeaponHoldType( "melee" );
    
    end
    
    self.Hit = { 
    Sound( "weapons/stunstick/stunstick_impact1.wav" ),
    Sound( "weapons/stunstick/stunstick_impact2.wav" ) };
    
    self.FleshHit = {
    Sound( "weapons/stunstick/stunstick_fleshhit1.wav" ),
    Sound( "weapons/stunstick/stunstick_fleshhit2.wav") };        
    self.Talk = {
    Sound( "none" ),
    Sound( "none" ),
Sound( "none" ) };

end

/---------------------------------------------------------
Name: SWEP:Precache( )
Desc: Use this function to precache stuff
---------------------------------------------------------
/
function SWEP:Precache()
end

function SWEP:DoFlash( ply )

    umsg.Start( "StunStickFlash", ply ); umsg.End();

end

/---------------------------------------------------------
Name: SWEP:PrimaryAttack( )
Desc: +attack1 has been pressed
---------------------------------------------------------
/
function SWEP:PrimaryAttack()

    if( CurTime() < self.NextStrike ) then return; end

    self.Owner:SetAnimation( PLAYER_ATTACK1 );
    self.Weapon:EmitSound( self.Sound );
    self.Weapon:SendWeaponAnim( ACT_VM_HITCENTER );

    self.NextStrike = ( CurTime() + .3 );
    
    if( CLIENT ) then return; end

    local trace = self.Owner:GetEyeTrace();

    if( not trace.Entity:IsValid() ) then
           return;
    end
    
    if( self.Owner:EyePos():Distance( trace.Entity:GetPos() ) > 100 ) then
            return;
    end
    
    if( SERVER ) then 
    
            local hp = trace.Entity:Health();
            hp = hp - math.random( 4, 8 );
            if( hp <= 0 ) then hp = 1; end
            
            trace.Entity:SetHealth( hp );
			
			local IsDoor = ents.FindByClass("func_door") or ents.FindByClass("func_door_rotating")
            
            if( not trace.Entity:IsDoor() ) then
                    trace.Entity:SetVelocity( ( trace.Entity:GetPos() - self.Owner:GetPos() ) * 7 ); 
            end
            
            if( trace.Entity:IsPlayer() ) then
                    timer.Simple( .3, self.DoFlash, self, trace.Entity );
                    self.Owner:EmitSound( self.FleshHit[math.random(1,#self.FleshHit)] );
            else
                    self.Owner:EmitSound( self.Hit[math.random(1,#self.Hit)] );
            end
            
    end

end

/---------------------------------------------------------
Name: SWEP:SecondaryAttack( )
Desc: +attack2 has been pressed
---------------------------------------------------------
/
function SWEP:SecondaryAttack()

    self.Owner:EmitSound( self.Talk[math.random(1,#self.Talk)] );

end

[/lua]

-snip- Ninja’d.

wish i knew what meant…

[editline]03:40PM[/editline]

same errors, no model…(V or W)

Fixed
[lua]
if( SERVER ) then

AddCSLuaFile( “shared.lua” );
resource.AddFile(“models/weapons/v_weiner.mdl”)
– We need to Add the models to players can see them
util.PrecacheModel(“models/weapons/v_weiner.mdl”)
– Then spawn them
resource.AddFile(“models/weapons/w_weiner.mdl”)
util.PrecacheModel(“models/weapons/w_weiner.mdl”)

end

if( CLIENT ) then

    SWEP.PrintName = "Admin Whacker";
    SWEP.Slot = 0;
    SWEP.SlotPos = 5;
    SWEP.DrawAmmo = false;
    SWEP.DrawCrosshair = false;

end

// Variables that are used on both client and server

SWEP.Author = “TacoNinja1995”
SWEP.Category = “*TacoNinja1995” – This was the error you forgot the " and Lexic is dumb.
SWEP.Instructions = “Left click to whack stuff.”
SWEP.Contact = “”
SWEP.Purpose = “”

SWEP.ViewModelFOV = 62
SWEP.ViewModelFlip = false
SWEP.AnimPrefix = “stunstick”

SWEP.Spawnable = false
SWEP.AdminSpawnable = true

SWEP.NextStrike = 0;

SWEP.ViewModel = “models/weapons/v_weiner.mdl”
SWEP.WorldModel = “models/weapons/w_weiner.mdl”

SWEP.Sound = Sound( “weapons/stunstick/stunstick_swing1.wav” );
SWEP.Sound1 = Sound( “none” );
SWEP.Sound2 = Sound( “none” );

SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = “”

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = 0
SWEP.Secondary.Automatic = false // Automatic/Semi Auto
SWEP.Secondary.Ammo = “”

/---------------------------------------------------------
Name: SWEP:Initialize( )
Desc: Called when the weapon is first loaded
---------------------------------------------------------
/
function SWEP:Initialize()

    if( SERVER ) then
    
            self:SetWeaponHoldType( "melee" );
    
    end
    
    self.Hit = { 
    Sound( "weapons/stunstick/stunstick_impact1.wav" ),
    Sound( "weapons/stunstick/stunstick_impact2.wav" ) };
    
    self.FleshHit = {
    Sound( "weapons/stunstick/stunstick_fleshhit1.wav" ),
    Sound( "weapons/stunstick/stunstick_fleshhit2.wav") };        
    self.Talk = {
    Sound( "none" ),
    Sound( "none" ),
Sound( "none" ) };

end

/---------------------------------------------------------
Name: SWEP:Precache( )
Desc: Use this function to precache stuff
---------------------------------------------------------
/
function SWEP:Precache()
end

function SWEP:DoFlash( ply )

    umsg.Start( "StunStickFlash", ply ); umsg.End();

end

/---------------------------------------------------------
Name: SWEP:PrimaryAttack( )
Desc: +attack1 has been pressed
---------------------------------------------------------
/
function SWEP:PrimaryAttack()

    if( CurTime() < self.NextStrike ) then return; end

    self.Owner:SetAnimation( PLAYER_ATTACK1 );
    self.Weapon:EmitSound( self.Sound );
    self.Weapon:SendWeaponAnim( ACT_VM_HITCENTER );

    self.NextStrike = ( CurTime() + .3 );
    
    if( CLIENT ) then return; end

    local trace = self.Owner:GetEyeTrace();

    if( not trace.Entity:IsValid() ) then
           return;
    end
    
    if( self.Owner:EyePos():Distance( trace.Entity:GetPos() ) > 100 ) then
            return;
    end
    
    if( SERVER ) then 
    
            local hp = trace.Entity:Health();
            hp = hp - math.random( 4, 8 );
            if( hp <= 0 ) then hp = 1; end
            
            trace.Entity:SetHealth( hp );
			
			local IsDoor = ents.FindByClass("func_door") or ents.FindByClass("func_door_rotating")
            
            if( not trace.Entity:IsDoor() ) then
                    trace.Entity:SetVelocity( ( trace.Entity:GetPos() - self.Owner:GetPos() ) * 7 ); 
            end
            
            if( trace.Entity:IsPlayer() ) then
                    timer.Simple( .3, self.DoFlash, self, trace.Entity );
                    self.Owner:EmitSound( self.FleshHit[math.random(1,#self.FleshHit)] );
            else
                    self.Owner:EmitSound( self.Hit[math.random(1,#self.Hit)] );
            end
            
    end

end

/---------------------------------------------------------
Name: SWEP:SecondaryAttack( )
Desc: +attack2 has been pressed
---------------------------------------------------------
/
function SWEP:SecondaryAttack()

    self.Owner:EmitSound( self.Talk[math.random(1,#self.Talk)] );

end

[/lua]

Thanks. I haven’t tested it yet, but at least you didn’t try once then just give up.

=p

dang it…same error, still no V or W model…

If ( CLIENT ) then
include(“shared.lua”)
end