ITEM.Name = "Fireball" ITEM.Class = "weapon" ITEM.Desc = "Warning: Warm" ITEM.Model = "models/props_debris/wood_board02a.mdl" ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_bow") ITEM.HoldType = "magic" ITEM.Recipe = { Resources = { ["Plank"] = 2, ["Rope"] = 1, ["Sap"] = 1, }, Tools = {}, } ITEM.CD = 1 function ITEM:DoFireball(pl) print("Fully successfull fireball callback:") print(pl) local aim = pl:GetAimVector() local fireball = {} fireball["model"] = "models/hunter/blocks/cube025x025x025.mdl" fireball["speed"] = 700 fireball["drop"] = 50 fireball["init"] = function(fb) fb:Ignite(10) end local D = ents.Create("ws_projectile") if(fireball.speed) then D.speed = fireball.speed end if(fireball.model) then D.model = fireball.model end if(fireball.drop) then D.drop = fireball.drop end if(fireball.init) then D.init = fireball.init end print("D's speed:" .. D.speed) D:SetPos(pl:GetShootPos()+aim*50) D:SetOwner(pl) D:SetAngles(aim:Angle()) D:Spawn() pl:EmitSound(Sound("physics/flesh/flesh_impact_hard.wav"),100,math.random(90,110)) end function ITEM:DoFireballFail() end function ITEM:OnPrimary(pl,tr) ParticleEffect("particletest.pcf",pl:GetPos(),pl:GetAngles(),pl) if (CLIENT) then return end pl:Cast("Fireball",self.DoFireball) end