• FireBullets
    2 replies, posted
Hey guys i've been debugging a very interesting yet bazaar problem. the function FireBullet creates a entity entity class : prop_physics entity model : models/hunter/plates/plate.mdl Its only created the first time the FireBullet function is ran [B]how do i know? [/B] I've overran the Spawn function, which basically just prints everytime something is spawned. [lua] local Mejs = FindMetaTable("Entity") local OldSpawn = Mejs.Spawn function Mejs:Spawn() local model = "unknown" local class = "unknown" if self:GetModel() ~= nil then model = self:GetModel() end if self:GetClass() ~= nil then class = self:GetClass() end print("spawning model: "..model, " class "..class) OldSpawn(self) end [/lua] Outcome: spawning model: models/hunter/plates/plate.mdl class prop_physics. It only prints when i shoot the gun, which runs FireBullets. (Yes i am 100% sure its FireBullets, i've debugged alot.) And it only prints once i am not bullshitting you i promise. [B]Does anyone on this planet know WHY (send this to garry)[/B] [lua] function SWEP:ShootBullet(dmg, numbul, cone) local bullet = {} bullet.Num = numbul bullet.Src = self.Owner:GetShootPos() bullet.Dir = self.Owner:GetAimVector() bullet.Spread = Vector(cone, cone, 0) bullet.Tracer = 1 bullet.Force = dmg bullet.Damage = dmg bullet.AmmoType = "Pistol" self.Owner:FireBullets(bullet) self:SendWeaponAnim(ACT_VM_PRIMARYATTACK) self.Owner:MuzzleFlash() self.Owner:SetAnimation(PLAYER_ATTACK1) end [/lua] [editline]6th March 2012[/editline] if someone solves this, you will get rated lua king x5
anyone
I'm 90% sure thats the Gravity Hull mod.
Sorry, you need to Log In to post a reply to this thread.