I'm trying to create an additional flashlight for my SWEP. All other flashlights I've seen before using env_projectedtexture entity running on serverside to work as the flashlight. Is it possible to re-create the same thing that env_projectedtexture doing using GMod LUA, and make it executable by client code?
Not really no. It MIGHT be possible, but it'd require a shit ton of work.
[QUOTE=Noi;48687391]You might want to use DynamicLight, you can pass directions to it.[/QUOTE]
yeah, but it is more like HL1/CS1.6 style flashlight and not GMod/HL2 style.
Well in theory, couldn't you just have the SWEP create an env_projectedtexture on the server's end, and then the client could use net messages to request the light to be removed/created (turned on/off) as needed?
[QUOTE=Z0mb1n3;48689582]Well in theory, couldn't you just have the SWEP create an env_projectedtexture on the server's end, and then the client could use net messages to request the light to be removed/created (turned on/off) as needed?[/QUOTE]
It's very easy to fuck that up and allow anyone create any amount of flashlights via clientside Lua and lag everyone on the server.
[QUOTE=Robotboy655;48689612]It's very easy to fuck that up and allow anyone create any amount of flashlights via clientside Lua and lag everyone on the server.[/QUOTE]
True, so then what about purely serverside, simply checking for (input.IsKeyDown and weapon:GetClass() == blah) and then creating a flashlight if one doesn't already exist?
Well, you can toy with custom sweps and dynamic lights and all that - but you gotta ask yourself first if it's worth the hassle.
[QUOTE=Netheous;48692023]Well, you can toy with custom sweps and dynamic lights and all that - but you gotta ask yourself first if it's worth the hassle.[/QUOTE]
Beauty is pain and beauty is certainly worth it.
Sorry, you need to Log In to post a reply to this thread.