That’s why I came here tho…
EDIT: Okay, I am just going to mess around, I gained some knowledge from 61 replies!!! What??? for a simple question…that I am too stupid to know the answer to this topic, thanks everyone!
That’s why I came here tho…
EDIT: Okay, I am just going to mess around, I gained some knowledge from 61 replies!!! What??? for a simple question…that I am too stupid to know the answer to this topic, thanks everyone!
Whoever wants it, here is the video I am using as a tutorial. Might be a little outdated so that could be the reason I am having trouble.
the video your using as a guide to doing the light switch has a problem that i can instantly spot that also is why when your defining light
and switch
as variables in your first post in this topic you made.
if you haven’t already, add local
before the names of them as that way of creating variables shown in the video in has been changed between 2017-2018
local light = script.Parent.Parent.Parent.Parent.LightBox -- This is the light bulb
local switch = script.Parent.Parent -- this is the switch
you might also wanna do the same to the onClick function too.
local function onClick()
if light.PointLight.Range == 10 then
light.PointLight.Range = 0
else
light.PointLight.Range = 10 --how bright you want it to be
end
end
note: if you wanna see if this does anything different than the new version of your script, copy the same script that your currently using and in the copyed script, delete everything thats inside of it and paste in the code i have provided.
I will keep that in mind. Though, I wouldn’t think that it would work because of the fact that it is in a folder, and not in the workspace. Thanks anyway!