Advertisement
MR_trollscripter

Roblox Lua scripting tutorial (for beginners)

Feb 22nd, 2020
4,773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. --my code script pack for game
  2.  
  3. --THE VARIBLES
  4. --------------------------------------
  5. --hello = 50
  6.  
  7. --bye = 20
  8.  
  9.  
  10. --print(hello+bye)
  11.  
  12. --myvariable = false (add before print hello + bye :D)
  13.  
  14. --myvariable = ("hi there this is a string") (string addable)
  15.  
  16. --print(myvariable)
  17.  
  18. --THE PROPERTYS
  19. --------------------------------------------------------------
  20.  
  21. --1.insert a part
  22. --2.mess around for a bit
  23.  
  24. --able to anchor i guess :/
  25. --and more :D
  26.  
  27. --the scripts for behaviors
  28. --------------------------
  29. -- Properties
  30.  
  31. --game.Workspace.Baseplate.BrickColor = BrickColor.new("New Yeller")
  32.  
  33. --or
  34.  
  35. --game.Workspace.Baseplate.Color = Color3.fromRGB(103,5,100)
  36.  
  37. --or
  38.  
  39. --game.Workspace.Baseplate.Transparency = 1
  40.  
  41. --or
  42.  
  43. --game.Workspace.Baseplate.Anchored = true (or false)
  44.  
  45. --or
  46.  
  47. --game.Workspace.brick.Position = Vector3.new(-54.93, 0.45, 31.19)
  48.  
  49.  
  50.  
  51.  
  52. --THE XYZ SCRIPTS
  53. -------------------------------------------------------------------------------------
  54.  
  55. --game.Workspace.brick.Position = game.Workspace.brick.Position + Vector3.new(50,0,0)
  56.  
  57.  
  58. --INSERTING BLOCKS
  59. --------------------------------------------------------------------
  60. --part = Instance.new("Part")
  61. --part.Anchored = true
  62. --part.BrickColor = BrickColor.new("Really red")
  63. --part.Position = Vector3.new(0,5,0)
  64.  
  65. --part.Parent = game.Workspace
  66.  
  67.  
  68.  
  69.  
  70. --WIRE LOOPING
  71. -------------------------------
  72.  
  73. --while true do
  74.  
  75.  
  76. --print("While loop passed")
  77.  
  78. --wait(0.5)
  79.  
  80. --end
  81.  
  82. --EXPAMPLE OF WIRE LOOPING
  83. -------------------------------------------------
  84.  
  85. --while true do (or false i guess?)
  86.  
  87. --wait(0.5)
  88.  
  89. --part = Instance.new("Part")
  90. --part.Anchored = true
  91. --part.BrickColor = BrickColor.new("Really red")
  92. --part.Position = Vector3.new(0,5,0)
  93.  
  94. --part.Parent = game.Workspace
  95.  
  96. --end
  97.  
  98.  
  99.  
  100.  
  101. --THE ALTERNATE
  102. ------------------------------
  103. --while 2+2==4 do (DO NOT DO 2+2==5 OR THE SCRIPT WONT RUN)
  104.  
  105. --wait(0.5)
  106.  
  107. --part = Instance.new("Part")
  108. --part.Anchored = true
  109. --part.BrickColor = BrickColor.new("Really red")
  110. --part.Position = Vector3.new(0,5,0)
  111.  
  112. --part.Parent = game.Workspace
  113.  
  114. --if 2+2==4 then
  115.  
  116. --else
  117.  
  118. --break
  119.  
  120. --end
  121.  
  122. --end
  123.  
  124. --print("While loop stopped")
  125.  
  126.  
  127.  
  128. --HOW TO STOP REPEAT
  129. ------------------------------------------
  130.  
  131. --while true do
  132.  
  133. --wait(0.5)
  134.  
  135. --part = Instance.new("Part")
  136. --part.Anchored = true
  137. --part.BrickColor = BrickColor.new("Really red")
  138. --part.Position = Vector3.new(0,5,0)
  139.  
  140. --part.Parent = game.Workspace
  141.  
  142. --if 2+2==5 then
  143.  
  144. --else
  145.  
  146. --break
  147.  
  148. --end
  149.  
  150. --end
  151.  
  152. --print("While loop stopped")
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162. --WELP THAT IS IT NOW HAVE FUN :D (rember to remove the -- when you paste to code in :) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement