diff options
| author | Apickx <apickx@cogarr.com> | 2018-03-08 20:15:37 -0500 |
|---|---|---|
| committer | Apickx <apickx@cogarr.com> | 2018-03-08 20:15:37 -0500 |
| commit | 4f48a4ec5f7a92857f518bba67deb52ab0ced988 (patch) | |
| tree | c640043c18db82e0a1392d5f4e0a6123857e5549 /gamemode/itemsystem/items/spell_fireball.lua | |
| parent | 9722802672a6edba9f7dd8f6a435a02284691925 (diff) | |
| download | wintersurvival2-4f48a4ec5f7a92857f518bba67deb52ab0ced988.tar.gz wintersurvival2-4f48a4ec5f7a92857f518bba67deb52ab0ced988.tar.bz2 wintersurvival2-4f48a4ec5f7a92857f518bba67deb52ab0ced988.zip | |
Fixed fireball
Fixed a bug with fireball spell, and projectile entity
Diffstat (limited to 'gamemode/itemsystem/items/spell_fireball.lua')
| -rw-r--r-- | gamemode/itemsystem/items/spell_fireball.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gamemode/itemsystem/items/spell_fireball.lua b/gamemode/itemsystem/items/spell_fireball.lua index 14bca66..dc7d7e0 100644 --- a/gamemode/itemsystem/items/spell_fireball.lua +++ b/gamemode/itemsystem/items/spell_fireball.lua @@ -10,6 +10,15 @@ ITEM.HoldType = "magic" game.AddParticles("particles/particletest.pcf") PrecacheParticleSystem("firetest") +ITEM.Structure = { + { + Bone = "ValveBiped.Bip01_R_Hand", + Model = "models/props_junk/Rock001a.mdl", + Size = Vector(1,1,1), + Pos = Vector(0,0,0), + Ang = Angle(0,0,0), + }, +} ITEM.Recipe = { Resources = { @@ -21,6 +30,7 @@ ITEM.Recipe = { } ITEM.CD = 0.25 +ITEM.Range = 9999 --[[ The number of fireballs a player has is held in a global table where each entry is @@ -46,7 +56,7 @@ fireball["onhit"] = function (self,data,phys) end end - self:Remove() + self.Remove(self) end function ITEM:DoFireball(pl) @@ -100,6 +110,10 @@ end function ITEM:OnPrimary(pl,tr) if CLIENT then return end print("Attempting to cast...") - pl:Cast("Fireball",fireballfunc,self) + if NumFireballs[pl] == nil or NumFireballs[pl] < 3 then + pl:Cast("Fireball",fireballfunc,self) + else + pl:ChatPrint("You can't summon any more fireballs") + end end RegisterItem(ITEM) |
