YouTube2Text

Lighting Manipulation - Roblox Advanced Scripting #34 (2025) — Transcript

by BrawlDev · 4,665 words · 615 segments · language en · Watch on YouTube

Full transcript

  1. 0:00thanks for stopping by everyone look at
  2. 0:01this amazing view with everything we can
  3. 0:04see from all the way up here everything
  4. 0:06here just looks so nice and you know
  5. 0:08what I think this calls for a
  6. 0:10celebration now the only thing I want to
  7. 0:12say is thank you for reaching this far
  8. 0:15into our game development journey and
  9. 0:17I'm hoping that we can create really
  10. 0:19successful Roblox games for the future
  11. 0:22[Music]
  12. 0:28cheers all right let's think about this
  13. 0:31for a minute this video is going to be
  14. 0:32about lighting manipulation which allows
  15. 0:34us to change the lighting system inside
  16. 0:37of a Roblox game it determines how
  17. 0:39lighting appears in a game and how it
  18. 0:41interacts with other objects and not
  19. 0:43only are we going to be changing some
  20. 0:45properties for this lighting system but
  21. 0:46we're also going to use scripting to
  22. 0:48change it as well and some examples of
  23. 0:50scripting that I've done here are these
  24. 0:52Street lamps whenever it becomes
  25. 0:54nighttime these Street lamps light up
  26. 0:56but when it becomes daytime the street
  27. 0:58lamps turn off and so that's an example
  28. 1:01of using scripting to manipulate the
  29. 1:03lighting and another thing is creating a
  30. 1:06dynamic day and night Cycle System from
  31. 1:08what you can see over there we're
  32. 1:09changing the time of day through
  33. 1:11scripting to create this little
  34. 1:13transition from daytime to night time
  35. 1:15and not only that but we also have
  36. 1:16lighting objects that completely
  37. 1:18transforms the way that a Roblox game
  38. 1:20can look and so what I'm going to do is
  39. 1:22I'm going to hit stop and show you what
  40. 1:24I'm talking about so right now inside of
  41. 1:25this Roblox game there's a lot of
  42. 1:27lighting objects but if I were to
  43. 1:28quickly get rid of all of these lighting
  44. 1:30objects then the game looks kind of
  45. 1:33bland I'm not going to lie so with these
  46. 1:35lighting objects this can really
  47. 1:37transform a Roblox game to make it look
  48. 1:40as good as possible and so that's what
  49. 1:41I'm going to be introducing to you as
  50. 1:43part of this tutorial guide while also
  51. 1:45manipulating the lighting through
  52. 1:46scripting and with that being said let's
  53. 1:48go ahead and go straight into the video
  54. 1:50now that we understand it let's
  55. 1:52Implement lighting manipulation inside
  56. 1:54Roblox studio now for the sake of this
  57. 1:56episode we're actually going to be using
  58. 1:57a template that Roblox has provided to
  59. 1:59us called Pirate Island just so that we
  60. 2:02can really demonstrate the capabilities
  61. 2:04of roblox's lighting system as we change
  62. 2:06it so if you want to follow along this
  63. 2:09is the template that we're going to be
  64. 2:10using so I'm just going to click on this
  65. 2:12and it should load up the template just
  66. 2:14like so and we can move around freely as
  67. 2:17such okay so once we have this template
  68. 2:19pulled up we can now change the
  69. 2:21lightings to reflect on this map that we
  70. 2:23have over here and the place we're going
  71. 2:24to do that is in this lighting folder
  72. 2:27inside of the Explorer now if we open
  73. 2:28this up we can see that there are
  74. 2:30lighting objects inside of here so what
  75. 2:32we're going to do is take everything
  76. 2:34that's in here and we're actually going
  77. 2:35to delete it so that we can start from
  78. 2:36scratch and the first thing that I want
  79. 2:38to show you are some basic properties
  80. 2:40that we can change within the lighting
  81. 2:43object itself just so that we have an
  82. 2:45idea of how we can change some of its
  83. 2:47properties and how it affects our game
  84. 2:50so we're going to select lighting which
  85. 2:52have some properties here and some of
  86. 2:53them are pretty self-explanatory we have
  87. 2:55a property called brightness which you
  88. 2:56can increase or decrease the brightness
  89. 2:59uh of the entire game you can even have
  90. 3:01shadows if you want so this basically
  91. 3:04gets rid of any Shadows if you have this
  92. 3:05turned off or you can turn this on um
  93. 3:08and then we have other things like
  94. 3:09technology which tells us what kind of
  95. 3:12lighting system do we want for our
  96. 3:14Roblox game because we can have
  97. 3:16different Lighting systems depending on
  98. 3:18the kind of game that we're creating so
  99. 3:20by default it's Shadow map but if we
  100. 3:21were to change this to something like
  101. 3:23voxel then this places less emphasis on
  102. 3:26the Shadows um in comparison to what we
  103. 3:29had by default fault and there is
  104. 3:30another one called future which puts
  105. 3:32more emphasis on certain parts that need
  106. 3:34to be brighter or dimmer so that's kind
  107. 3:37of what that is and there are other
  108. 3:38properties here like ambient and outdoor
  109. 3:40ambient which I can tell you what
  110. 3:42ambient is it's it's sort of like a
  111. 3:43color filter that displays onto the
  112. 3:45entire world using a specific color so
  113. 3:48if we select this and we pick something
  114. 3:50like let's say red and we hit okay then
  115. 3:53it's going to have like this red tint
  116. 3:56around the entire game and we also have
  117. 3:57something called outdoor ambient which
  118. 3:59is slightly different than ambient so if
  119. 4:02I were to change outdoor ambient to
  120. 4:04let's say yellow and hit okay then there
  121. 4:06is a difference here so ambient puts
  122. 4:09emphasis on places that are indoors like
  123. 4:12this little Hut over here so you can see
  124. 4:14that this has like a red tint but if we
  125. 4:16were to look at our outdoor ambient
  126. 4:17which is now yellow we can see that this
  127. 4:19places emphasis on lighting that's quote
  128. 4:22unquote outside so that's basically what
  129. 4:24those two properties do and finally one
  130. 4:26other property that I want to introduce
  131. 4:27to you is called fog which has three
  132. 4:29properties the fog color the fog end and
  133. 4:31fog start so fog end is basically how
  134. 4:35far away do we want the fog to be in
  135. 4:37studs and this is a really big number
  136. 4:40like 100,00 so we can't really see the
  137. 4:42fog but if we were to reduce this to
  138. 4:44something as small as let's say a
  139. 4:45thousand then we can start seeing fog
  140. 4:48surrounding the entire map now fog start
  141. 4:50basically does the opposite where this
  142. 4:53is how many studs we need to be in order
  143. 4:55for the fog to actually come in so we
  144. 4:57can say that this is 100 and we can see
  145. 5:00that there's now like a little bit of
  146. 5:01space uh between our camera and where
  147. 5:04the fog starts and then we have a fog
  148. 5:06color of course we can change that to
  149. 5:08something different if we want and those
  150. 5:10are some lighting properties that I hope
  151. 5:11that you'll find useful inside of your
  152. 5:14Roblox game and that's basically that
  153. 5:16okay so now I want to show you some
  154. 5:18lighting objects that we can add to make
  155. 5:19our game look better and all of these
  156. 5:21are going to be contained inside of the
  157. 5:23lighting folder so what we're going to
  158. 5:25do is hit the plus sign next to lighting
  159. 5:27and as you can see there's a lot of
  160. 5:28effects that we can add to our game and
  161. 5:31the first one I want to show you is
  162. 5:33called Sunrise effect so if we click on
  163. 5:35this then what it's going to do is it's
  164. 5:37going to add Rays uh or visual arrays in
  165. 5:41this case to the sun that's inside of
  166. 5:43the game so if I were to delete this
  167. 5:45then this is what the sun normally looks
  168. 5:46like but if we added the sun rays then
  169. 5:48this is what the sun now looks like and
  170. 5:50we can change some basic properties here
  171. 5:52as well like the intensity of the Sunray
  172. 5:55and even the spread of the Sunray as
  173. 5:57well and that is basically what we can
  174. 5:58do with Sunray now another effect we can
  175. 6:01add is called color correction so if we
  176. 6:04add this then this gives us some basic
  177. 6:06lighting properties that we can change
  178. 6:07to make our game look better or to fit
  179. 6:10the type of game that we're creating so
  180. 6:11we have properties like brightness uh
  181. 6:13contrast even saturation and also the
  182. 6:16tint color as well but a lot of these
  183. 6:18properties are similar to the properties
  184. 6:20that are inside of the lighting folder
  185. 6:22itself so this is like an added layer to
  186. 6:25the lighting properties that we
  187. 6:26discussed about earlier in this episode
  188. 6:28so another object we can add is called a
  189. 6:31blur effect and I think this one is
  190. 6:33pretty self-explanatory so I don't need
  191. 6:34to go into detail about this one I'm
  192. 6:36just going to quickly disable it here
  193. 6:38and I'm also going to add a bloom effect
  194. 6:41which is basically how our lighting
  195. 6:42system responds to very bright objects
  196. 6:45so if I were to show you an example I'm
  197. 6:47going to go to model and I'm going to
  198. 6:48hit part and I'm going to make the
  199. 6:50material of this neon and what I'm going
  200. 6:53to do with this Bloom effect is I'm
  201. 6:55going to change the threshold to
  202. 6:58something smaller and as you can see uh
  203. 7:01the neon part is now brighter because I
  204. 7:03lowered the threshold for it and if I
  205. 7:05were to let's say change the size of it
  206. 7:07as well then we can see that this is now
  207. 7:09even brighter than it was before so
  208. 7:11that's what the bloom effect does and
  209. 7:13finally I want to talk about depth of
  210. 7:16field effect so if we click on this then
  211. 7:19what this does is it brings Focus to
  212. 7:22certain objects that are close to our
  213. 7:24camera and it's going to make everything
  214. 7:26else blurry so as you can see right here
  215. 7:29my phone Focus here is on this rock but
  216. 7:31everything that's surrounding it is
  217. 7:32blurred out in the distance and so we
  218. 7:34can change some properties like far
  219. 7:36intensity Focus distance uh we can even
  220. 7:38change things like in Focus radius and
  221. 7:41near intensity as well and we have this
  222. 7:44little depth of field going on where
  223. 7:47whatever's closest to us this is what's
  224. 7:49visible but anything that's in the
  225. 7:51distance is blurred out so that's
  226. 7:53basically what depth of field is and so
  227. 7:55I hope that some of these properties
  228. 7:56have given you insight to change them
  229. 7:58around to fit whatever kind of Roblox
  230. 8:00game that you're creating and now let's
  231. 8:02move on I would also like to add skies
  232. 8:05and atmospheres now to explain what a
  233. 8:07sky is it's basically a sky box that
  234. 8:10contains six images one for each side of
  235. 8:14the game to be displayed inside of our
  236. 8:16world so this is the default sky for
  237. 8:19every single Roblox game but we can add
  238. 8:20our own Sky by either creating six
  239. 8:22images and putting them together inside
  240. 8:24of a sky object or we could just go to
  241. 8:27the toolbox and look for a sky that was
  242. 8:29created by the community so if we go to
  243. 8:32view and then hit toolbox and we search
  244. 8:35inside of model let's say sky then we
  245. 8:37can look at all these Skies that we can
  246. 8:39put inside of our game so I'm just going
  247. 8:41to select this one called neon City sky
  248. 8:43and once we do that we can see that the
  249. 8:46sky has now changed to be this neon City
  250. 8:49sky and there are six images for each
  251. 8:53side of this Sky Box and so that's
  252. 8:55essentially what a sky object is and we
  253. 8:58can also add an atmosphere
  254. 8:59to the sky as well by clicking on the
  255. 9:01plus sign next to lighting and we're
  256. 9:03just going to insert an atmosphere just
  257. 9:05like this so an atmosphere supplements
  258. 9:08the sky that we've added into our game
  259. 9:10to add like this little effect so we can
  260. 9:12change things like the density and we
  261. 9:14can change things like the offset as
  262. 9:16well to see a very slight difference
  263. 9:18there and we can even add other things
  264. 9:20like a haze effect and even a glare
  265. 9:23effect um with these different colors as
  266. 9:26you see right over here it's not very
  267. 9:28practical for for this kind of sky that
  268. 9:30we have over here but you get the idea
  269. 9:32this is something that you can add
  270. 9:33inside of your game as well and I hope
  271. 9:35that you utilize these two objects
  272. 9:37inside of your game as well okay but now
  273. 9:39I want to get into the scripting aspect
  274. 9:41of lighting and the two properties that
  275. 9:43we're mostly going to be interested in
  276. 9:44are called clock time and time of day so
  277. 9:47these two properties are used to tell
  278. 9:50the in-game time of the game that we're
  279. 9:52currently playing so the way that time
  280. 9:55is represented inside of a Roblox game
  281. 9:58is through a new numerical value from 0
  282. 10:01to 24 and these are represented in hours
  283. 10:04so let's say we are at hour Zer so I'm
  284. 10:06just going to click on clock time and
  285. 10:08I'm going to set this to zero we can see
  286. 10:11that we are now at hour zero which is
  287. 10:13basically midnight in this case but if
  288. 10:16we were to change this up then it's
  289. 10:18going to go from 0 a.m. to 1:00 a.m. to
  290. 10:212 a.m. to 3:00 a.m. and it's just going
  291. 10:23to keep going until it has now reached
  292. 10:25morning time and it is now High Noon
  293. 10:27which is 12: and then it's going to keep
  294. 10:29on going and it's now going to become
  295. 10:31nighttime again and then it's going to
  296. 10:33go all the way back around to zero so
  297. 10:37that's how time works inside of a Roblox
  298. 10:39game now you might be asking why are
  299. 10:41there two properties to know the time
  300. 10:44that is currently inside of the game the
  301. 10:46reason that we have two different
  302. 10:48properties is because time of day is a
  303. 10:5024-hour formatted string that tells us
  304. 10:53three pieces of information it tells us
  305. 10:56the current hour the current number of
  306. 10:58minutes and the current number number of
  307. 10:59seconds clock time doesn't really do
  308. 11:01that because this is a numerical
  309. 11:03representation of the time that's inside
  310. 11:05of the game so for example if I were to
  311. 11:07change the clock time to let's say 14.7
  312. 11:10then what it's going to show here for
  313. 11:12the time of day is 14 hours and 42
  314. 11:15minutes which cannot be represented
  315. 11:17using this clock time uh numerical value
  316. 11:20that's over here so that's the
  317. 11:21difference between the two and I hope
  318. 11:23that that has made sense so with what we
  319. 11:25know let's create a day and night cycle
  320. 11:27script and we're going to be doing this
  321. 11:28on the server side so that the lighting
  322. 11:31is going to be changing for every single
  323. 11:33player so what we're going to do is hit
  324. 11:35the plus sign next to server script
  325. 11:36service and we're going to insert a
  326. 11:38script now inside of the script what
  327. 11:39we're going to do is locate lighting by
  328. 11:41saying local lighting equals game colon
  329. 11:45get service lighting just like this and
  330. 11:48there are two variables that we're going
  331. 11:50to create and these are going to be
  332. 11:51constant variables with information that
  333. 11:54we're going to need for this lighting
  334. 11:55script the first one being the time
  335. 11:58speed so so how fast is time going to be
  336. 12:01moving and that's going to be determined
  337. 12:03by this variable which we're going to
  338. 12:04call local _ speed and we're going to
  339. 12:08set this equal to 300 which we're going
  340. 12:10to make more sense of this later but the
  341. 12:12next variable that we're going to need
  342. 12:14is the start time so the starting hour
  343. 12:17that we're going to be starting at so
  344. 12:19we're going to say local start time and
  345. 12:22we're going to set this equal to let's
  346. 12:24say 9 so hour 9 is like 9:00 a.m. in the
  347. 12:28morning that's basically what this
  348. 12:29represents so we're going to create
  349. 12:31another variable but this one is going
  350. 12:32to change throughout the script and
  351. 12:35basically this one is going to tell us
  352. 12:37how many minutes have passed since
  353. 12:40midnight has struck and so what I'm
  354. 12:42referring to here is if we were to type
  355. 12:45local minutes after midnight just like
  356. 12:49this and we set this equal to start time
  357. 12:53time 60 then this gives us information
  358. 12:56about how many minutes have passed after
  359. 12:58midnight it might seem a little
  360. 12:59confusing to you but let me try and um
  361. 13:01explain to you this way so start time is
  362. 13:05however many hours have passed since
  363. 13:07midnight which as we remember when we
  364. 13:09first played the game the clock time at
  365. 13:11its earliest time is zero which is
  366. 13:14midnight so start time here is the hour
  367. 13:179 and because we need the minutes that
  368. 13:20have passed since midnight we have to
  369. 13:23convert the start time to minutes and
  370. 13:26how do we convert the hours to minutes
  371. 13:28we multiply it by 60 so that's how we
  372. 13:31got this result and this is going to be
  373. 13:33useful to us to change the lighting as
  374. 13:36we are working through with the script
  375. 13:38and I hope that this is making sense so
  376. 13:39far so what we're going to do down here
  377. 13:41is write a while true do statement like
  378. 13:44this and what we're going to do here is
  379. 13:46say minutes after midnight plus equals 1
  380. 13:49so we're going to take however many
  381. 13:50minutes have passed since midnight and
  382. 13:52we're just going to Simply add one to
  383. 13:54that and with this updated minutes after
  384. 13:57midnight we're going to use a lighting
  385. 13:59method to update the minutes that have
  386. 14:02passed after midnight and so this is
  387. 14:04what we're going to do we're going to
  388. 14:05say lighting colon set minutes after
  389. 14:10midnight open close parentheses and what
  390. 14:12we're going to throw inside of here is
  391. 14:14the minutes after midnight variable just
  392. 14:16like so and what we can do to finish
  393. 14:18this off is say task. we and we can put
  394. 14:21whatever we want inside of here we can
  395. 14:23say 0.01 just to have a very smooth
  396. 14:26transition for when we're updating the
  397. 14:28time so that's basically our script if
  398. 14:30we go into the game and I want to
  399. 14:31demonstrate this without the atmosphere
  400. 14:33in the sky and all these other uh
  401. 14:35lighting objects so I'm just going to
  402. 14:36select all of these and hit disable and
  403. 14:39I'm also going to delete the sky and the
  404. 14:41atmosphere so if we hit test and hit
  405. 14:43play then what we should see is if we
  406. 14:46select lighting our clock time is being
  407. 14:49updated every 0.01 seconds and the
  408. 14:52changes are being reflected in the sky
  409. 14:54as you can see with the sun going down
  410. 14:56and the moon going up and it's going to
  411. 14:58keep keep doing this repeatedly as long
  412. 15:00as the game is running because this is
  413. 15:02all inside of a while true do statement
  414. 15:04and that is how we create a day and
  415. 15:06night cycle inside of a Roblox game now
  416. 15:08if you want to be more fancy we can add
  417. 15:10our own weight time variable just like
  418. 15:12this we're going to drop a line here and
  419. 15:14say local Weight time and we're going to
  420. 15:16set this equal to 60 / time speed just
  421. 15:21like this and we replace this 0.01
  422. 15:25seconds inside of task. wait with this
  423. 15:27weit time here with 60 divided by
  424. 15:30whatever the time speed was over here so
  425. 15:32the weight time would be 60 divided by
  426. 15:34our time speed which is up here so if we
  427. 15:37have a larger time speed then that means
  428. 15:39the weight time is going to be smaller
  429. 15:41and smaller so if we were to have a
  430. 15:43weight time of 300 then it's going to
  431. 15:46run pretty slowly but if we were to have
  432. 15:48a Time speed of let's say um 10,000 and
  433. 15:52we were to go into the game and hit play
  434. 15:55then what we should see is that the time
  435. 15:56should be moving really quickly inside
  436. 15:59of the game um if we were to just load
  437. 16:01up here then you can see that the sun is
  438. 16:02going down the moon is going up and it's
  439. 16:05going to keep on going just like that
  440. 16:06and if I were to go back and quickly
  441. 16:09change this to let's say 300 again then
  442. 16:12time is going to move really slow but
  443. 16:14it's still going to move as long as the
  444. 16:16script is running so that is basically
  445. 16:20how we create a day and night cycle and
  446. 16:22I hope that you found this part to be
  447. 16:23useful so to wrap up this video we're
  448. 16:25going to create this Street Lamp that
  449. 16:28lights up whenever whenever the time in
  450. 16:30game becomes nighttime and it's going to
  451. 16:32turn off once it becomes daytime inside
  452. 16:35of the actual game using our day and
  453. 16:37night cycle script so that is going to
  454. 16:39be the challenge for today's episode so
  455. 16:41I want you to try and create this Street
  456. 16:43Lamp yourself before you watch the
  457. 16:45implementation of this tutorial and once
  458. 16:48you think you've given a fair shot at
  459. 16:50scripting this then we can go ahead and
  460. 16:52move straight into the implementation
  461. 16:54all right so first thing we're going to
  462. 16:55do is go to model hit part just like
  463. 16:58this
  464. 16:59we're going to Anchor this part just
  465. 17:02like so this is going to be our pole and
  466. 17:05we're just going to extend it out like
  467. 17:07this so we're going to rename this to
  468. 17:09pole just like so and what I'm going to
  469. 17:11do is duplicate this move it up just
  470. 17:14like this I'm going to scale it down and
  471. 17:18I'm going to move this outward like this
  472. 17:23it doesn't have to be perfect
  473. 17:25necessarily and now we have a little
  474. 17:29light source over here and I'm also
  475. 17:32going to make the color of this black as
  476. 17:35well to indicate that it is not turned
  477. 17:37on right now so this is our little light
  478. 17:39post right here so what I'm going to do
  479. 17:42is rename our poll to light I'm going to
  480. 17:46take the pole and the light and I'm
  481. 17:47going to right click and hit group as
  482. 17:49model so I'm going to call this street
  483. 17:53light just like this and what I'm now
  484. 17:55going to do is add what's called a point
  485. 17:58light light inside of the light part so
  486. 18:00I'm going to hit the plus sign and I'm
  487. 18:01going to insert a point light now this
  488. 18:05point light is basically what allows us
  489. 18:06to give light to a specific part inside
  490. 18:10of the game and we can change things
  491. 18:11like the range and the brightness of it
  492. 18:13as well I I should have explained this
  493. 18:15during the tutorial but I wanted to
  494. 18:17quickly add here that there are light
  495. 18:19objects that you can add to parts inside
  496. 18:22of the game to add light to them we can
  497. 18:24even do the same thing with other light
  498. 18:25objects there's Spotlight and there's
  499. 18:27also surface light so I encourage you to
  500. 18:29experiment with these ones as well but
  501. 18:31for the sake of this challenge we're
  502. 18:32going to use Point light okay so now
  503. 18:35what we're going to do is insert a
  504. 18:37script inside of street light and we're
  505. 18:39first going to make reference to
  506. 18:41lighting by saying local lighting equals
  507. 18:44game colon get service lighting just
  508. 18:47like this and what we're going to do
  509. 18:50here is we're going to use a change
  510. 18:53signal event to tell us whenever the
  511. 18:56clock time of the lighting changes then
  512. 18:58we're going to basically fire this event
  513. 19:00and check if the lighting is at an
  514. 19:02appropriate time to turn on the light or
  515. 19:06turn off the light so what we're going
  516. 19:08to do is say lighting colon get property
  517. 19:13changed signal open and close
  518. 19:16parenthesis and in quotations we're
  519. 19:18going to say clock time colon connect
  520. 19:21function open and close parentheses
  521. 19:23enter just like this and up here we
  522. 19:26should make reference to the light part
  523. 19:27so what we're going to do is say say
  524. 19:29Local Light part equals script. parent
  525. 19:32colon wait for child light just like
  526. 19:35this and the first thing we're going to
  527. 19:36do is check the clock time to see if
  528. 19:39it's night time and we're going to do
  529. 19:40this using two checks so we're going to
  530. 19:43say if lighting. clock time is greater
  531. 19:47than or equal to 18 I I'm going to say
  532. 19:5018 because our 18 is generally the time
  533. 19:53when it becomes night time hour 17 is
  534. 19:55like Sunset so that's why we're going to
  535. 19:56say 18 um so we can say if it has
  536. 20:00reached sunset or we can say if
  537. 20:02lighting. clock time is less than or
  538. 20:05equal to 6 because if we remember zero
  539. 20:08is midnight and six is like 6 in the
  540. 20:10morning um so if we do this then this is
  541. 20:14nighttime so what we're going to do here
  542. 20:15is say light part. material equals enum
  543. 20:20material. neon we're also going to
  544. 20:22change the color of it by saying light
  545. 20:24part. color equals color 3. from RGB and
  546. 20:29from here we're going to select let's
  547. 20:31say yellow and another thing we're going
  548. 20:33to do is say light part. Point light.
  549. 20:38enabled equals
  550. 20:39true so this is what's going to happen
  551. 20:42if it becomes nighttime it's going to
  552. 20:44turn on this um street light but if
  553. 20:48that's not the case and it is daytime
  554. 20:50then we're just going to take everything
  555. 20:51that was here and we're going to set it
  556. 20:53back to what it originally was so the
  557. 20:55material here is going to be plastic the
  558. 20:57color is going to to be black and the
  559. 21:01point light is not going to be enabled
  560. 21:03so this is basically our entire script
  561. 21:05right here so if we go back to the game
  562. 21:06I'm quickly going to um disable the
  563. 21:09point light that's here and now if we go
  564. 21:11to test and hit play then what we should
  565. 21:14see is when it's daytime nothing happens
  566. 21:17with this Street Lamp but once it
  567. 21:20becomes nighttime then it's going to
  568. 21:21trigger the Street Lamp to uh change its
  569. 21:25color its material and also activate the
  570. 21:28point like as well and then it turns
  571. 21:30back off once it becomes daytime again
  572. 21:31so that is basically how you create a
  573. 21:33street light and if we want to make the
  574. 21:35light more noticeable we can change the
  575. 21:36range and we can change the brightness
  576. 21:38of it as well to really see the
  577. 21:41effect so if we go back into the game
  578. 21:44then we should really be able to see the
  579. 21:45difference
  580. 21:51now so as you can see we can now see
  581. 21:54that there is light being displayed on
  582. 21:55the Street Lamp although it is really
  583. 21:57really bright but you get the idea at
  584. 21:59this point so that is essentially how we
  585. 22:01create a Street Lamp inside of Roblox
  586. 22:03using our day and night cycle that we
  587. 22:04created and I hope that you found this
  588. 22:05to be really informative if you found
  589. 22:07this video to be informative then I
  590. 22:09would really appreciate it if you left a
  591. 22:11like on this video and if you haven't
  592. 22:12subscribed to the channel I encourage
  593. 22:14you to do that if you haven't so already
  594. 22:16and if you have done the Street Lamp
  595. 22:18Challenge and you have the script for it
  596. 22:20then I encourage you to share it in the
  597. 22:21comment section so that we can see how
  598. 22:23you did it differently compared to the
  599. 22:25script that I showed in this episode I
  600. 22:27would like to give a shout out to all my
  601. 22:28patreon members for their continued
  602. 22:30support their support has really helped
  603. 22:31me continue through with this journey
  604. 22:33and I really appreciate it so if you
  605. 22:34want to support me and get access to all
  606. 22:36my scripts and other benefits then I
  607. 22:38encourage you to become a patreon member
  608. 22:40as well the link will be in the
  609. 22:41description so that's going to be it for
  610. 22:43this episode please check out my other
  611. 22:44videos that are on the advanced
  612. 22:46scripting tutorial guide playlist and
  613. 22:47with that being said I will see you in
  614. 22:49the next
  615. 22:50one take care

About this transcript

This page contains the full transcript of Lighting Manipulation - Roblox Advanced Scripting #34 (2025) by BrawlDev, generated from the public captions YouTube serves with the video. The transcript has 4,665 words across 615 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.