Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //SMOKEBOMB START
- local CanUse_smoke = true
- local timeCD = 60
- hook.Add("Think", "smokebomb_in_use", function (ply)
- local ply = LocalPlayer()
- if ply:PS_HasItemEquipped("smokebomb") then
- if input.IsKeyDown(KEY_G) and CanUse_smoke == true then
- local smokeduration = 3
- local pos = ply:GetPos()
- local ang = ply:GetAngles()
- local h = ScrH()
- local l = ScrW()
- local smoke1 = Model("particle/particle_smokegrenade")
- local smoke2 = Model("particle/particle_noisesphere")
- local function makeSmoke()
- for i = 1, 25 do
- local smokes = {smoke1, smoke2}
- local emm = ParticleEmitter(pos)
- local ent_smoke = emm:Add(table.Random(smokes), pos)
- if ent_smoke then
- local gray = math.random(50, 150)
- ent_smoke:SetColor(gray, gray, gray)
- ent_smoke:SetLifeTime(0)
- ent_smoke:SetStartAlpha(255)
- ent_smoke:SetEndAlpha(200)
- ent_smoke:SetVelocity(VectorRand() * math.Rand(900, 1300))
- ent_smoke:SetDieTime(math.Rand(50, 70))
- ent_smoke:SetStartSize(350)
- ent_smoke:SetEndSize(math.random(1, 40))
- ent_smoke:SetRoll(math.random(-180, 180))
- ent_smoke:SetRollDelta(math.Rand(-0.1, 0.1))
- ent_smoke:SetAirResistance(600)
- ent_smoke:SetCollide(true)
- ent_smoke:SetBounce(0.4)
- ent_smoke:SetLighting(false)
- CanUse_smoke = false
- timer.Simple(timeCD, function ()
- CanUse_smoke = true
- end)
- end
- end
- end
- makeSmoke()
- end
- end
- end)
- //SMOKEBOMB END
- //Coded from scratch by Zero
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement