The rates of the scripts in my game keeps increasing to quite a large amount. What’s causing it and does it affect performance? The activity % are pretty much stable compared to the rates.
Rate is how much the script runs per second, and it does affect performance. A rate of 3600 and 12000 is pretty alarming and I would definitely consider checking the script that is causing this high rate. There is a lot that can easily cause a script’s rate to go out of control, for example a block that is constantly touching something else has the Touched event connected in a script.
I see, however, this is one of the script and it’s just a basic flicking light script, but it still goes up to 1886/s.
function toggleOff()
script.Parent.SpotLight.Enabled = false;
script.Parent.Material = Enum.Material.SmoothPlastic;
script.Parent.Attachment.PointLight.Enabled = false;
end
function toggleOn()
script.Parent.SpotLight.Enabled = true;
script.Parent.Material = Enum.Material.Neon;
script.Parent.Attachment.PointLight.Enabled = true;
end
while true do
wait(1);
toggleOff()
for a=1, 2 do
wait(0.1);
toggleOn();
wait(0.1);
toggleOff()
end
wait(2);
toggleOn();
end
Very odd, looks like it is probably the bug referenced earlier then. The only possibility I could think of is that there is a memory leak within the script which causes the script to never truly end.
Thanks for the help, I just confirmed this on studio… I ran the scripts in a new place at extreme mode (spawning and killing 100 humanoids every 2 secs) and the rates were reasonable.