-
Notifications
You must be signed in to change notification settings - Fork 3
/
trail.lua
29 lines (26 loc) · 1.11 KB
/
trail.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--name trail
--desc create a trail behind you created of beams
--author sekc
local lastPos = Vector(0, 0, 0)
function onCreateMove(cmd)
if cmd.tickcount % 2 == 0 and cmd.tickcount > 0 then
if eclipse.isInGame() then
local localPlayer = entitylist.getEntity(entitylist.getLocalPlayer())
if localPlayer:sane() then
if ui.getConfigBool("trail rainbow") then
ui.setConfigCol("trail color", draw.HSVtoColor((cmd.tickcount % 128) / 128, 1, 1, 1))
end
beam.createBeam(lastPos, localPlayer:origin(), "sprites/purplelaser1.vmt", ui.getConfigCol("trail color"), ui.getConfigFloat("trail life"), ui.getConfigFloat("trail width"), 0)
lastPos = localPlayer:origin()
end
end
end
end
function onUI()
ui.colorPicker("trail color", "trail color")
ui.sliderFloat("trail life", "trail life", 0, 10, "%.2f")
ui.sliderFloat("trail width", "trail width", 0, 10, "%.2f")
ui.checkbox("rainbow", "trail rainbow")
end
eclipse.registerHook("createMove", onCreateMove)
eclipse.registerHook("UI", onUI)