sau2000
(sau2000)
January 16, 2022, 5:27am
#1
When I clone a script and parent it to a NumberValue, the script does not run.
That is the script I want to clone
This is the contents of the script I cloned
repeat wait(0.5) print("waiting") until script.Parent.Name == "padlockequip"
for i = 1,10,1 do
print("In loop")
wait(1)
end
script.Parent:Destroy()
The code I used to clone the script
local Script = scripttoadd:Clone()
Script.Parent = thething
Script.Disabled = false
It looks like that in the game
Try this:
repeat task.wait() until script.AncestryChanged
for i = 1,10,1 do
print("In loop")
wait(1)
end
script.Parent:Destroy()
No need to disable script.
NyrionDev
(Nyrion)
January 16, 2022, 5:34am
#3
What’s the path of padlockequip
?
sau2000
(sau2000)
January 16, 2022, 5:34am
#4
What does that mean?-----------------------------------------------------------
NyrionDev
(Nyrion)
January 16, 2022, 5:35am
#5
The entire path inside the explorer, for example game.Players.Player.Values.padlockequip
.
NyrionDev
(Nyrion)
January 16, 2022, 5:40am
#7
I just checked and no, Scripts
and LocalScripts
can’t run directly under the player instance. Although Scripts
are able to run inside Backpack and LocalScripts
inside PlayerGui .
Forummer
(Forummer)
January 16, 2022, 5:42am
#8
Player scripts are parented to the PlayerScripts folder of the player instance.
NyrionDev
(Nyrion)
January 16, 2022, 5:43am
#9
That’s correct, I forgot to mention PlayerScripts
, although only LocalScripts
can run there.