Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mat = Material("sprites/light_ignorez")
- local duration = 1
- local delay = 3.75
- local max_speed = 5000
- local sound_played = false
- hook.Add("HUDPaint", "teamrocket", function()
- local time = RealTime()
- local size = math.sin(time * 5) * 10
- local rotation = time * 100
- surface.SetMaterial(mat)
- surface.SetDrawColor(255, 255, 255, 255)
- for k,v in pairs(ents.GetAll()) do
- if v:GetClass() ~= "class C_HL2MPRagdoll" then continue end
- local len = v:GetPhysicsObjectNum(1):GetVelocity():Length()
- if not v.star_time and len > max_speed then
- v.star_start = time + delay
- end
- if v.star_start and v.star_start < time then
- if not v.star_time then
- v.star_time = time + duration
- end
- if v.star_time > time then
- local pos = v:EyePos():ToScreen()
- local delta = (v.star_time - time) / duration
- if pos.visible then
- surface.DrawTexturedRectRotated(pos.x, pos.y, delta * 128 + size, delta * 128 + size, rotation)
- end
- if not v.star_sound_played then
- surface.PlaySound("chatsounds/autoadd/misc/jtechsfx/asdasd.wav")
- v.star_sound_played = true
- end
- elseif len < max_speed then
- v.star_time = nil
- v.star_sound_played = true
- v.star_start = nil
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment