Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Under init() in MapEdit.gsc add this at the end of the thread:
- foreach(player in level.players)
- {
- player thread doLightUpList();
- }
- //Then add the following thread anywhere in MapEdit.gsc
- doLightUpList()
- {
- LightUp((-123,456,789), 100, 0.3)
- }
- // Function simplified:
- // LightUp(<co-ordinates>, <range>, <brightness>);
- // Required arguments:
- // 1. <co-ordinates> - The co-ordinates of the light source (middle of dark room)
- // 2. <range> - How far from the co-ordinates you can be before the light is gone
- // 3. <brightness> - The maximum brightness (recommended - 0.3)
- //Then add this thread anywhere:
- LightUp( coords, range, bn )
- {
- self endon("disconnect");
- self endon("death");
- self setClientDvar("r_brightness", 0);
- self.left=0;
- for(;;)
- {
- if(Distance(coords, self.origin) <= range)
- {
- self setClientDvar("r_brightness", bn);
- wait 0.01;
- }
- if(Distance(coords, self.origin) > range && self.left == 1)
- {
- for(i = bn; i > 0; i-=0.02)
- {
- self setClientDvar("r_brightness", i);
- self.left=0;
- wait 0.01;
- }
- }
- wait 0.01;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement