• Looking for an add-on regarding sprays and blood splatter.
    6 replies, posted
So I have a game mode where the players will use sprays a lot, and they use weapons, so there will be lots of blood. The problem I am having is that sprays and blood splatters stay there until I restart the server, or if i use the console commands r_cleardecals. The cleardecals is only client side and only removes it for the player entering the command. I am looking for an add-on that changes how long blood/sprays stay. I am not asking for someone to code me one by the way. I am asking if anybody KNOWS any add-on's that do this. If you need me to explain more in-depth, please reply down below. Thanks in advance!
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf335-2.html[/url] [url]http://wiki.garrysmod.com/page/timer/Create[/url] That will clean map after so seconds,
Im not looking for an addon that clears the whole map of all props, just of blood stains,bullet holes, and sprays every X seconds. and i can change that value.
From al little bit of research there's no way to replicate the r_cleardecals client command, so the best solution would be just to force the player to run the command after X amount of seconds, infinitely. [lua] local seconds = CreateClientConVar( "clear_decals", 15, true, false ) -- default is 15 timer.Create( "clear_decals", seconds:GetInt(), 0, function() RunConsoleCommand( "r_cleardecals" ) end cvars.AddChangeCallback( "clear_decals", function( name, old, new ) if timer.Exists( "clear_decals" ) then timer.Destroy( "clear_decals" ) end timer.Create( "clear_decals", new, 0, function() RunConsoleCommand( "r_cleardecals" ) end end ) [/lua]
So is that script up there saying every 15 seconds it will automatically run r_cleardecals for all the clients? or is it 15 minutes. Also, if i want this on my RP server, where would i put said script above?
15 seconds, changed by the console variable "clear_decals", which defaults to 15 seconds. Placing the code above into a file in lua/autorun/client or into a client file (eg. cl_init.lua) should work fine.
If i put it in my gmod server/lua/autorun/client would it work foreveryone?
Sorry, you need to Log In to post a reply to this thread.