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)