I am looking to write a script that I can run which would flash/blur your screen while playing music for a set amount of time. I have no idea where to start, any suggestions would help.
Draw a giant rectangle on the screen?
You can play a song by either doing
RunConsoleCommand('play', <song dir>)
or
surface.PlaySound( <song dir> )
After that, you would want to create timers to make the screen flash with the beat.
[lua]
flash_toggle = false
function flash()
flash_toggle = true
timer.Simple(0.1, function()
flash_toggle = false
end)
end
local function DoFlash()
local tab = {}
tab[ "$pp_colour_brightness" ] = 1
tab[ "$pp_colour_contrast" ] = 1
tab[ "$pp_colour_colour" ] = 1
if flash_toggle == true then
DrawColorModify( tab )
end
end
hook.Add( "RenderScreenspaceEffects", "Show a flash on the screen!", DoFlash )
[/lua]
I'm way too tired to check if that works, I wouldn't trust my tired coding but you get the idea.
Sorry, you need to Log In to post a reply to this thread.