• Lights/library Help Please!!
    4 replies, posted
Hey, i just had a question. Is their another way to create a light, Without using DynamicLight? Because I want something that ALL players can see but... I've noticed DynamicLight is CLIENT Side only. If theirs a way to make it Serverside and Client side that would be a awesome. [code] local ply = LocalPlayer() local veh = ply:GetVehicle() local rand = math.random(1,2) local dlight = DynamicLight( veh:EntIndex() ) dlight.Pos = veh:GetPos() -- The position where the light spawns dlight.Brightness = 2 -- Brightness don't make it higher then 2 My god its gets glitchy dlight.Size = 4000 -- Max Size dlight.Decay = 10 -- How far it will take to fade off dlight.DieTime = CurTime() + 0.7 -- Time to fade off dlight.r = 0 -- Red dlight.g = 0 -- Green dlight.b = 0 -- Blue end [/code]
Using the network library you can have the light created on all clients. Broadcast a net message to all the clients, and then create the light. [url]http://wiki.garrysmod.com/page/Net_Library_Usage[/url]
[URL="http://facepunch.com/showthread.php?t=1423116"]You asked this a week ago,[/URL] what was wrong with those answers?
I tested it, the dynamicLights need to be an entity which i found out to day... By seeing how Neon lights addon in the coderhire... now i'm trying to get it to randomize. And i'm thinking its needing net variables and shit...
If you are gonna to randomize by using net messages, you're gonna to overflow net messages with your color vars Do it from client side...The properties names on dlights says what they do
Sorry, you need to Log In to post a reply to this thread.