Ok, so I am working on a plugin and I had to make a script that assigns an id for each place.
My plugin includes a coregui so I inserted a script and a Number Value object to it, and I'm parenting my screen gui to game:GetService("CoreGui")
with the script and value inside. the script is generating a number for the id, after that i script:Destroy()
it. i also print the id just to make sure it's working, and it does print it.
Code in this script:
local i = math.random(1, 1000000) math.randomseed(i) script.Parent.id.Value = tonumber(tostring(math.random()):sub(3, 12)) print(script.Parent.id.Value) script:Destroy()
But after it's printed, and I try printing it again from somewhee else it prints 0. https://gyazo.com/c9dad33fae4b62c18c52c786dacc6951
What is wrong?