althruist
(althruist)
November 11, 2023, 8:22pm
#1
Hi everyone,
I’m currently working on a module and I had to make this for the module to work.
-- Wait for player
if not Players.LocalPlayer then
repeat task.wait(0.5) until Players.LocalPlayer
end
For some reason the module script loaded quicker than the player or something. Will this cause any memory leaks? Thanks.
Aki
2 Likes
You can answer this question yourself through stats in the developer console, I don’t think it will have any affect on the memory at all because of the high wait duration.
3 Likes
KultDeeri
(Kult)
November 11, 2023, 8:35pm
#3
It will not, instead it would just yield the current script, and that’s about it.
3 Likes
althruist
(althruist)
November 11, 2023, 8:37pm
#4
Oh alright! Thanks to both!
I’m a little uneducated when it comes to memory leaks, so that’s why I got a bit concerned haha.
1 Like
SpiralAPI
(arlo)
November 12, 2023, 6:59am
#6
nope, this will not leak memory
not to be mistaken however, doing this on the server is unadvisable as it will keep repeating task.wait
until the player is found.
1 Like
system
(system)
Closed
November 26, 2023, 6:59am
#7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.