✓ Accepted answer
Hi! .Changed would not work because "ReloadTime" is a number value. So for you, I changed it to while wait(1) do. Even if .Changed did work, it would do nothing since you aren't actually changing it until the end of your function.
local Beam = script.Parent
local ReloadTime = math.random(1,10)
while wait(1) do
ReloadTime = math.random(1,10)
Beam.Size = Vector3.new(1,1,4)
wait(ReloadTime)
Beam.Size = Vector3.new(55,1,4)
wait(1)
local ReloadTime = math.random(1,10)
end
Now that code will work, but if you truly want it to be random not just 1 or 10, Id recommend adding a math.randomseed(tick()) so the wait will be between 1 and 10 not just 1 or 10.
local Beam = script.Parent
local ReloadTime = math.random(1,10)
math.randomseed(tick())
while wait(1) do
ReloadTime = math.random(1,10)
Beam.Size = Vector3.new(1,1,4)
wait(ReloadTime)
Beam.Size = Vector3.new(55,1,4)
wait(1)
local ReloadTime = math.random(1,10)
end
And if you really want , you can make the beam sizes random too. If this helped, please accept, otherwise tell me so.
1 comment
thx this help out a lot