Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

if game.Workspace.setup.Value == 1 then is running when value is 0. whats going on?

so. I have made a script to clone spheres. question 1: do the scripts of clones run when created? question 2: if not, how do you make it run? question3: so the script, first when the game runs then a setup part of the script runs, NOT the script I want the clones to have. when the clones are created, sometimes in output I get the message "sphere setup started" and that's the exact opposite of what its supposed to do. whyyyyy? here is me code:

local sphere = script.Parent
local setup = game.Workspace.setup
if setup.Value == 1 then
wait(6)
print("sphere setup started")
sphere.Transparency = 1
while true do
wait(1)
print("creating sphere...")
cloned = sphere:Clone()
    cloned.Parent = sphere.Parent
print("creating sphere...")
end
end
if setup.Value == 0 then
sphere.Transparency = 0
print("sphere created")
end

1 answer

✓ Accepted answer

you can disable the cloned script, and have the cloner script enable the cloned script after it has been cloned and everything

i will call the cloned script: "clonedScript" and disable the cloned script

cloner:

local cloned = clonedScript:Clone()
cloned.Parent = *where you want to cloned script to be*
cloned.Disabled = false

4 comments

0

can you post some code for that?

0

edited

0

nevermind! i fixed it meself

0

here, have free reputation for helping

This discussion is preserved as it was. New answers, comments, and votes are closed.