Advertisement
This is comment for paste
[FIXED!] (TF2) RGB Crosshair Script
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- code to generate colors:
- local function chCol(r,g,b,alias)
- return 'alias "ch_col'..alias..'" "cl_crosshair_red '..r.."; cl_crosshair_green "..g.."; cl_crosshair_blue "..b..'; alias ch_next_col ch_col'..(alias+1)..'; wait 3; ch_col_next"'
- end
- local function clamp(n, min, max)
- if n < min then return min end
- if n > max then return max end
- return n
- end
- local rgb = {256, 0, 0}
- local dir = 1
- local mag = 16
- local pos = 2
- local count = 1
- while count <= 2*(256/mag)*3 do
- local r,g,b = rgb[1],rgb[2],rgb[3]
- local red,grn,blu = clamp(r,0,255),clamp(g,0,255),clamp(b,0,255)
- print(chCol(red,grn,blu,count))
- rgb[pos] = rgb[pos] + mag*dir
- if dir == 1 then
- if rgb[pos] == 256 then
- pos = pos%3+1
- pos = pos%3+1
- dir = dir * -1
- end
- else
- if rgb[pos] == 0 then
- pos = pos%3+1
- pos = pos%3+1
- dir = dir * -1
- end
- end
- count = count + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement