@navdeepchani-legacy (navdeepchani) posted a new topic, subject "How to send blur/screen effects to client?". It read:

   Hi I have a script which plays music upon a victim dieing in TTT, this works but I can't get the motion blur to work. Here is my code:
    [code] 
        
        hook.Add("PlayerDeathSound", "DeFlatline", function() return true end)
        local noise = Sound("sadviolin.wav")
        hook.Add("PlayerDeath", "NewSound", 
        	function(vic,unused1,unused2) 
        		vic:EmitSound(noise)  
        		vic:SendLua(DrawMotionBlur( 0.1, 0.79, 0.05))
        end)
        
        
        
    [/code]

To which @LennyPenny-legacy (LennyPenny) replied

    SendLua takes a string, that string will then excuted on the client.  
    [lua]  
    vic:SendLua(“RunConsoleCommand( “mat_motion_blur_enabled”, 1 )”)  
    [/lua]
    
    But you don't need to use sendlua for that, just use  
    [lua]  
    vic:ConCommand(“mat_motion_blur_enabled 1”)  
    [/lua]
    
    wiki.facepunch.com
    
    ### Garry's Mod Wiki
    
    Welcome to the Garry's Mod Wiki! Current game discussion as well as update progress can be found on Discord. You can test changes for the next update on the Dev beta branch through Steam. The Garry's Mod Lua Source Code is available on GitHub. To...

@navdeepchani-legacy (navdeepchani) replied

    LennyPenny:
    
    > SendLua takes a string, that string will then excuted on the client.  
    >  [lua]  
    >  vic:SendLua(“RunConsoleCommand( “mat_motion_blur_enabled”, 1 )”)  
    >  [/lua]
    > 
    > But you don't need to use sendlua for that, just use  
    >  [lua]  
    >  vic:ConCommand(“mat_motion_blur_enabled 1”)  
    >  [/lua]  
    >  http://wiki.garrysmod.com/page/Player/ConCommand
    
    i don't think mat_motion_blur_enabled 1 does anything? i tried searching it up but couldn't find anything. I've now got motion blur working but it's always on and i keep trying stuff but i can't make it happen when someone dies. I need it to only apply motion blur after someone dies and then reset after a few seconds, here is what I got so far:
    [code] 
        
        hook.Add("PlayerDeathSound", "DeFlatline", function() return true end)
        noise = Sound("sadviolin.wav")
        
        hook.Add("PlayerDeath", "NewSound", 
        	function(vic,unused1,unused2)
        		vic:EmitSound(noise)
        end)
        
        
        function blur()
        	DrawMotionBlur( 0.2, 0.99, 0.01 )
        end
        
        hook.Add("RenderScreenspaceEffects", "blurtest", blur)
        
        
        
    [/code]

After which, @Author.legacy (Author.) added

    Snip too late   
    i'll help you when im home.

@navdeepchani-legacy (navdeepchani) replied

    Author.:
    
    > Snip too late   
    >  i'll help you when im home.
    
    alright cheers ^^

Then @crazyscouter-legacy (crazyscouter) said

    Send a net message that on receive via the client you add a hook , the one that you're using right now, that calls your blur function. The, outside of the hooks function, create a simple timer that calls hook.Remove to get rid of the effect. On my phone so it's hard to go into detail.


{'source': 'discourse', 'url': 'https://forum.facepunch.com/t/how-to-send-blur-screen-effects-to-client/188563', 'title': 'How to send blur/screen effects to client?', 'views': 380, 'has_accepted_answer': False, 'word_count': 357, 'like_count': 0, 'reply_count': 5, 'participant_count': 4, 'posts': 6, 'tags': '', 'author': '@navdeepchani-legacy (navdeepchani)', 'participants': '@navdeepchani-legacy (navdeepchani), @LennyPenny-legacy (LennyPenny), @Author.legacy (Author.), @crazyscouter-legacy (crazyscouter)', 'image_url': [None], 'created_at': '2014-08-25T18:11:28.000Z', 'last_posted_at': '2014-08-25T21:37:46.000Z'}