• Wtf is wrong with this?
    8 replies, posted
Ok this is what prevents me from finishing my PEZ gun: ENTITY: [code] AddCSLuaFile( "shared.lua" ) include( 'shared.lua' ) function ENT:SpawnFunction(ply, tr) if (!tr.HitWorld) then return end local ent = ents.Create("PEZ_Candy") ent:SetPos(tr.HitPos + Vector(0, 0, 10)) ent:Spawn() // Spawn it return ent end function ENT:Initialize() self.Entity:SetModel( "models/PROPS_C17/light_industrialbell02_on.mdl" ) self.Entity:PhysicsInit( SOLID_VPHYSICS ) self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) self.Entity:SetSolid( SOLID_VPHYSICS ) util.PrecacheSound("vo/SandwichEat09.wav") util.PrecacheSound("") local phys = self.Entity:GetPhysicsObject() if (phys:IsValid()) then phys:Wake() end end function ENT:Use( activator, caller ) if ( activator:IsPlayer() ) then activator:EmitSound ("vo/SandwichEat09.wav") local health = activator:Health() activator:SetHealth( health + 20 ) self.Entity:Remove() end end [/code] SWEP [code] if ( SERVER ) then AddCSLuaFile( "shared.lua" ) end if ( CLIENT ) then SWEP.PrintName = "PEZ GUN" SWEP.Author = "Ye Olde Snake" SWEP.DrawCrosshair = true SWEP.DrawAmmo = false SWEP.Slot = 1 SWEP.SlotPos = 0 SWEP.ViewModelFOV = 60 SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none" end function SWEP:PrimaryAttack() self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK) self.Weapon:EmitSound(self.Weapon.Primary.Sound) self.Weapon:SendWeaponAnim( ACT_VM_RELOAD ) self.Weapon:SetNextPrimaryFire( CurTime() + 0.3 ) if (!SERVER) then return end local Candy = ents.Create("PEZ_Candy") local Phys = Candy:GetPhysicsObject() end end [/code] What the hell am i making wrong?
What is the problem you are having?
it wont even show up on the list
It aint got no model? (The Swep)
-Snip long night-
[QUOTE=Gbps;19128796]"models/PROPS_C17/light_industrialbell02_on.mdl" is not a viewmodel and cannot be used on a weapon. If you're looking for one to use for a weapon, you'll need to find a modeler.[/QUOTE] That model is the entity, note it is in the ENTITY: part of the code.
can we get to the point here?
Sorry, you need to Log In to post a reply to this thread.