I'm confused why it's still not working the problem is the value doesn't go up but the stuff gets printed... like it says check for the print"check")
local v = game.Lighting:WaitForChild("ONE") local sway = math.random(1, 100) * math.random(0.05, 0.15) local y = math.random(1,10) local x = math.random(1,1) while wait() do y=math.random(1,10) wait(15) print("Changing Values...") v.Value = v.Value + sway if y == 5 then v.Value = v.Value * 1.1 * math.random(1.7, 2.1) print("Multiplied ONE") elseif y == 6 then v.Value = v.Value - v.Value + 2.50 print("ONE just crashed!!!") elseif y == 6 then v.Value = v.Value + sway print("check") elseif y == 7 then v.Value = v.Value + sway print("check") elseif y == 8 then v.Value = v.Value + sway print("check") elseif y == 9 then v.Value = v.Value + sway print("check") elseif y == 10 then v.Value = v.Value + sway print("check") elseif y == 4 then v.Value = v.Value + sway print("check") elseif y == 3 then v.Value = v.Value + sway print("check") elseif y == 2 then v.Value = v.Value + sway print("check") elseif y == 1 then v.Value = v.Value + sway print("check") end end
I don't think math.random
accepts decimals as arguments. Use Random.new
instead, like so:
local ran = Random.new() local sway = ran:NextNumber(0.05, 15)
You can read the wiki about the Random
datatype here.