I know this is very amateur but i don't know how I would make it do what the title entails.
This is what i have so far:
L = script.Parent.PointLight.Brightness
function RNG()
local N = math.random(.1,1.2)
L = N
end
while true do
wait(math.random(.3,.7))
RNG()
end
I want to make it so each time the function is called it generates a new number. The function call works; however, the brightness of the point light doesn't change.

2 comments
I think I know why, make a new variable called "Wait" and put this to the variable: math.random(0.3, 0.7). Then for line 9, just make it say: wait(Wait).
Well the problem isnt that the wait doesnt work, the problem is that the math.random in the RNG function doesnt change the brightness