I am not 100% sure if the performance difference is due to local script vs server script, but I am using the following code in a local script that is stored in the player's gui section:
function foo()
print("Hello")
wait(0.05)
print("Foo!")
wait(0.05)
if playerHasFoo then
foo()
end
end
When I run this code within the Roblox Studio editor, it runs quite fast. But when I publish and test this code from the Roblox Player, it seems to run a bit noticeably slower. I am using this code to make an automatic weapon that fires and the wait(0.05) is being used as a delay in between shots fired so that all the shots don't fire at once.
I have tested on multiple computers as well and I don't think it's a networking issue. I have only found 1 article on the wait() function on how to avoid lag in your projects, but it didn't really help me with this problem. I don't think I fully understand how wait() works and that is why my code is not working the way I want it to.
Any help is appreciated.
