Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Keep getting warnings while trying to set parent?

Asked by 4 years ago

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

0
try setting it to snowflake.Parent, I don't think that will help but try. mixgingengerina10 223 — 4y
0
no luck, thanks for trying to help tho jediplocooon 7 — 4y
0
Can you write the tree of that script? ex: ScreenGui -> Frame -> Snowflake & Script mixgingengerina10 223 — 4y
0
StarterGui -> ScreenGui - > Script & SnowFlake jediplocooon 7 — 4y
View all comments (2 more)
0
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 mixgingengerina10 223 — 4y
0
That's alright, thanks for trying! jediplocooon 7 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You will need to state the clone's parent in another line of code, such as:

local copy = snowflake:Clone()
copy.Parent = script.Parent
0
I also tried that, and it still gives me the same error jediplocooon 7 — 4y
0
Oh sorry, the - is supposed to be a "=" CrypxticDoge 135 — 4y
0
There it should be good CrypxticDoge 135 — 4y
0
It still shows the same error as what I originally used jediplocooon 7 — 4y
0
Ok CrypxticDoge 135 — 4y
Ad

Answer this question