hello,
im trying to create a script that, once it's cloned into a specific folder, runs it's script.
currently, the game creates a folder (folder A) within an already existing folder (folder B) in ServerStorage, then clones a script into folder A. the script starts with:
local ServerStorage = game:GetService("ServerStorage")
if script.Parent.Parent.Parent == ServerStorage then
--script here
end
which, is not only extremely embarrassing to post and grossly inefficient, but also doesn't work. surprise surprise.
im still very new to this. i am looking up tutorials and checking the API when i can but i cant find anything that could help me in this regard. whats worse is that this has actually worked before - when cloning a simple object into the workspace that had a script attached that checked if it was in the workspace, then fired its script. but its not working for this more complex script.
i dont know what to do. im sure there are better ways of doing what i want to, and even of doing it in this manner, but i just dont know. any feedback or ideas would be fantastic.
thank you in advance.
PS: im sorry you had to read that script abomination

3 comments
If*
thank you so much for the response. ive been stuck on how to solve this problem for a while now. i know checking the api reference probably isnt the right way to learn lua, but ive just been doing what i can to learn more here and there. unfortunately, the code snippet didn't work - however it may still be the thing that im looking for. from what i could gather (from the api reference, lel)
it checks if the specified value of an instance has changed, correct? either way, thank you for your help.