I was trying to make a script that would change the range of a pointlight randomly, except, it throws no errors, but the Range doesn't change at all...
I've posted the whole scripts because I've got no error to reference for a line.
local Range = script.Parent.PointLight.Range
function onPlayerEntered()
while true do
wait(.1);
a = math.random(0,2)
wait(.1);
if a == 1 then
Range = Range - math.random(2,14)
else
if a == 2 then
Range = Range + math.random(2,10);
end
end
end
end
game.Players.PlayerAdded:connect(onPlayerEntered)
onPlayerEntered(game.Players:WaitForChild("Player1")) |