Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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

Log in to vote
2
Answered by 7 years ago
Edited 7 years ago

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!

0
Thank very much! Hyperpublic 4 — 7y
Ad

Answer this question