I have a tool where it clones itself. I want to run this script itself(not function inside or chunks, but script itself) but it seems i cant find a way to. When i searched for it, I found a method called dofile() but it won`t work.. Is there any way to do this? Also, is there a way not to make the script run when not needed, like it only runs when it is called.
(The code below is what i kind of want to do)
script1:
if --[[tool--]] .Parent ~= game.Workspace then
--call the script2
end
script2:
local toolClone = script.Parent:Clone()
toolClone.Name = "toolClone"
toolClone.Parent = game.Workspace--makes appear the tool to game, since it was in serverStorage

1 comment
oh i planned to put destroy() the cloned script but totally forgot about it lol. Thankyou btw