I have this script inside of a screen gui in the player, that's supposed to create a bunch of snowflakes while the value is true, which it does correctly, but once it starts cloning snowflakes the gui lags really bad and it shows this error Something unexpectedly tried to set the parent of SnowFlake to NULL while trying to set the parent of SnowFlake. Current parent is SnowFlakeGui. Can anybody show me what I'm doing wrong?
local snowflake = script.Parent.SnowFlake
local generatesnow = game.Players.LocalPlayer.leaderstats.generatesnow
while generatesnow.Value == true do
wait(math.random(1, 100)/100)
snowflake:Clone().Parent = script.Parent
end

6 comments
try setting it to snowflake.Parent, I don't think that will help but try.
no luck, thanks for trying to help tho
Can you write the tree of that script? ex: ScreenGui -> Frame -> Snowflake & Script
StarterGui -> ScreenGui - > Script & SnowFlake
Very weird, I made the same setup and made an int value with the same name and it works. Sorry, but I can't help:C
That's alright, thanks for trying!