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

I started learning. What does ~ sp = script.Parent ~?

This may seem like a stupid question, but I started learning scripts and I need someone to explain this:

sp = script.Parent

What does this script? What mean?

1 answer

✓ Accepted answer

In this script you are assigning the global variable sp to the value script.Parent.
This means that script.Parent is the parent of the script!
We can then simply access it using the variable sp!
What does this mean?
If you insert a script into workspace, the parent of the script becomes workspace!
This is because that roblox uses a hierarchy. For more information on this click this link.
It is also important to know about global variables, and local variables, for more information, click this link.
I hope this helps, if it does, please accept!

1 comment

0

Thank very much!

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