I need help making a screen effect for when someone uses my swep. I want their screen to get extremely bright, then fade back to normal. I tried something with a for loop and failed at the math. Also a for loop will go way to fast for the player to see it. :( I was using pp_colormod_brightness, and I don't know if I should use color mod as I have never made a screen effect before. Here is my fail function that I attempted.
[lua]
function SWEP:PrimaryAttack()
RunConsoleCommand("pp_colormod", "1")
for i = 0.1, 1 do
RunConsoleCommand("pp_colormod_brightness", 1 - i)
end
end
[/lua]
Help.
Use [url=http://wiki.garrysmod.com/?title=G.DrawColorModify]DrawColorModify()[/url] not a console command. To make it fade smoothly use [url=http://wiki.garrysmod.com/?title=Math.Approach]math.Approach()[/url].
Sorry, you need to Log In to post a reply to this thread.