Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Property editing is where you edit the properties of an object
- And also welcome to the part where you can start seeing results of your scripting!
- Firstly, Lets make a variable and set it's value as an Object
- ]]
- object = script
- --[[
- As you notice, the object's value is "script", If your wondering, its not a variable
- "script" is the script itself, now, You can add ".Parent" to see the 'parent' of the script
- ]]
- object = script.Parent
- --[[
- This might be a bit confusing at first, but you will notice that the value of the variable
- named "object", is the Parent of this script (aka: the folder named "1 | Intro")
- Roblox's Workspace works on somewhat like a directory system
- Here is an image to help visualize it: https://gyazo.com/27d985e2b913a6594a27ed4fb8d7d14e
- When you select something in roblox studio, you will see it's properties (https://gyazo.com/1f610599f0da5368e3e8161552145184)
- You can edit the properties via script or manual editing.
- Here is an example of editing a variable
- ]]
- script.Name = "newname" --this changes the name of the script to something else
- script.Parent.Name = "secondname" --this changes the name of the parent to something else
- --[[
- Generally everything else should be explanatory, You can edit a property in an object if it
- exists in the object
- You can also do this:
- ]]
- object = script.Parent
- object.Name = "newExample"
- textTaken = object.Name --(note that editing this value will not change the object's name, it just sets the variable's value to this)
- print(textTaken)
- -->newExample
- --[[
- Lets say you want to get something from a different place in the game, then you can use "game."
- Example:
- ]]
- game.Workspace.Effects.Name = "new"
- workspace.Effects.Name = "new" --does same thing as above, "workspace" is the same as "game.Workspace"
- --[[
- If the name of an object has a space or special character in it, you have to do it like this:
- https://gyazo.com/c82deff83ba69f836f1158301fc4d663
- ]]
- script.Parent.Parent["1 | Intro"]["1 | Variables + Print"].Name = "name"
- script.Parent.Humanoid.WalkSpeed += 10 --random example i also added
- --[[
- sorry if this seems rushed, had something important to do during this time
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement