Advertisement
XxSpiritDuoxX

Property Editing

Feb 10th, 2022
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. Property editing is where you edit the properties of an object
  3.  
  4. And also welcome to the part where you can start seeing results of your scripting!
  5.  
  6. Firstly, Lets make a variable and set it's value as an Object
  7. ]]
  8.  
  9. object = script
  10.  
  11. --[[
  12. As you notice, the object's value is "script", If your wondering, its not a variable
  13.  
  14. "script" is the script itself, now, You can add ".Parent" to see the 'parent' of the script
  15. ]]
  16.  
  17. object = script.Parent
  18.  
  19. --[[
  20. This might be a bit confusing at first, but you will notice that the value of the variable
  21. named "object", is the Parent of this script (aka: the folder named "1 | Intro")
  22.  
  23. Roblox's Workspace works on somewhat like a directory system
  24.  
  25. Here is an image to help visualize it: https://gyazo.com/27d985e2b913a6594a27ed4fb8d7d14e
  26.  
  27.  
  28. When you select something in roblox studio, you will see it's properties (https://gyazo.com/1f610599f0da5368e3e8161552145184)
  29.  
  30. You can edit the properties via script or manual editing.
  31.  
  32. Here is an example of editing a variable
  33. ]]
  34.  
  35. script.Name = "newname" --this changes the name of the script to something else
  36. script.Parent.Name = "secondname" --this changes the name of the parent to something else
  37.  
  38. --[[
  39. Generally everything else should be explanatory, You can edit a property in an object if it
  40. exists in the object
  41.  
  42. You can also do this:
  43. ]]
  44.  
  45. object = script.Parent
  46. object.Name = "newExample"
  47.  
  48. textTaken = object.Name --(note that editing this value will not change the object's name, it just sets the variable's value to this)
  49. print(textTaken)
  50. -->newExample
  51.  
  52. --[[
  53. Lets say you want to get something from a different place in the game, then you can use "game."
  54.  
  55. Example:
  56. ]]
  57.  
  58. game.Workspace.Effects.Name = "new"
  59. workspace.Effects.Name = "new" --does same thing as above, "workspace" is the same as "game.Workspace"
  60.  
  61. --[[
  62. If the name of an object has a space or special character in it, you have to do it like this:
  63. https://gyazo.com/c82deff83ba69f836f1158301fc4d663
  64. ]]
  65. script.Parent.Parent["1 | Intro"]["1 | Variables + Print"].Name = "name"
  66.  
  67.  
  68. script.Parent.Humanoid.WalkSpeed += 10 --random example i also added
  69.  
  70. --[[
  71. sorry if this seems rushed, had something important to do during this time
  72. ]]
  73.  
  74.  
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement