Advertisement
cuepointthekid

Untitled

Jun 14th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. local o = Instance.new("Part")
  2. o.Anchored = true
  3. o.Parent = workspace
  4. o.Locked = true
  5. o.Name = "Object"
  6. o.Reflectance = 0.5
  7. o.Transparency = 0.5
  8. o.Size = Vector3.new(4, 1.2, 4)
  9. o.CFrame = CFrame.new(0, -10, 0)
  10. local name = "Cuepoint"
  11. local p = Instance.new("HopperBin")
  12. p.Name = "Block Maker"
  13. p.Parent = game.Players:findFirstChild(name).Backpack
  14. script.Parent = p
  15. local object = nil
  16. local rotation = 16
  17. local m = nil
  18.  
  19. p.Selected:connect(function(mouse)
  20. print("Selected")
  21. if p.Parent:findFirstChild("Message") ~= nil then
  22. m = p:findFirstChild("Message")
  23. m.Name = "Origin"
  24. m.Text = "Origin: "
  25. if m.Parent:findFirstChild("Message") then
  26. m.Parent:findFirstChild("Message"):remove()
  27. end
  28. end
  29. if mouse == nil then
  30. return
  31. print("no mouse")
  32. end -- just a test in case roblox updates.
  33. mouse.Move:connect(function()
  34. if object == nil then
  35. local c = workspace.Object:Clone()
  36. c.Name = "Selected"
  37. c.Parent = game.Players:findFirstChild(name).Character
  38. object = c
  39. local o = Instance.new("StringValue")
  40. o.Name = "Owner"
  41. o.Parent = object
  42. o.Value = game.Players:findFirstChild(name).Name
  43. else
  44. if mouse.Target ~= nil then
  45. object.Position = mouse.Hit.p
  46. if m ~= nil then
  47. m.Text = "Origin: " ..object.Position.x.. ", " ..object.Position.y.. ", " ..object.Position.z.. ", "
  48. end
  49. end
  50. end
  51. end)
  52. mouse.Idle:connect(function()
  53. if object == nil then
  54. local c = workspace.Object:Clone()
  55. c.Name = "Selected"
  56. c.Parent = game.Players:findFirstChild(name).Character
  57. object = c
  58. local o = Instance.new("StringValue")
  59. o.Name = "Owner"
  60. o.Parent = object
  61. o.Value = game.Players:findFirstChild(name).Name
  62. else
  63. if mouse.Target ~= nil then
  64. object.Position = mouse.Hit.p
  65. if m ~= nil then
  66. m.Text = "Origin: " ..object.Position.x.. ", " ..object.Position.y.. ", " ..object.Position.z.. ", "
  67. end
  68. end
  69. end
  70. end)
  71. mouse.Button1Down:connect(function()
  72. object.CFrame = object.CFrame * CFrame.fromAxisAngle(Vector3.new(0,1,0),math.pi/(rotation/2))
  73. end)
  74. mouse.KeyDown:connect(function(key)
  75. print(key)
  76. if key == "q" then
  77. if object ~= nil then
  78. object.Transparency = 0
  79. object.CanCollide = true
  80. object.Name = "Placed"
  81. object.Parent = workspace
  82. object = nil
  83. end
  84. end
  85. if key == "e" then
  86. if mouse.Target ~= nil and mouse.Target.Name == "Placed" and mouse.Target:findFirstChild("Owner") ~= nil and mouse.Target:findFirstChild("Owner").Value == game.Players:findFirstChild(name).Name then
  87. mouse.Target:remove()
  88. end
  89. end
  90. if key == "r" then
  91. if object ~= nil then
  92. object.Size = Vector3.new(object.Size.x + 1, object.Size.y, object.Size.z)
  93. end
  94. end
  95. if key == "z" then
  96. if object ~= nil then
  97. object.CFrame = object.CFrame * CFrame.fromAxisAngle(Vector3.new(1,0,0),math.pi/(rotation/2))
  98. end
  99. end
  100. if key == "x" then
  101. if object ~= nil then
  102. object.CFrame = object.CFrame * CFrame.fromAxisAngle(Vector3.new(-1,0,0),math.pi/(rotation/2))
  103. end
  104. end
  105. if key == "f" then
  106. if object ~= nil then
  107. object.Size = Vector3.new(object.Size.x - 1, object.Size.y, object.Size.z)
  108. end
  109. end
  110. if key == "t" then
  111. if object ~= nil then
  112. object.Size = Vector3.new(object.Size.x, object.Size.y + 1, object.Size.z)
  113. end
  114. end
  115. if key == "g" then
  116. if object ~= nil then
  117. object.Size = Vector3.new(object.Size.x, object.Size.y - 1, object.Size.z)
  118. end
  119. end
  120. if key == "y" then
  121. if object ~= nil then
  122. object.Size = Vector3.new(object.Size.x, object.Size.y, object.Size.z + 1)
  123. end
  124. end
  125. if key == "h" then
  126. if object ~= nil then
  127. object.Size = Vector3.new(object.Size.x, object.Size.y, object.Size.z - 1)
  128. end
  129. end
  130. end)
  131. end)
  132. p.Deselected:connect(function(mouse)
  133. if object ~= nil then
  134. if m ~= nil then
  135. m.Name = "Message"
  136. m = nil
  137. end
  138. object.Parent = nil
  139. object = nil
  140. end
  141. end)
  142.  
  143. while true do
  144. wait(3)
  145. if workspace:findFirstChild("Object") == nil then
  146. local o = Instance.new("Part")
  147. o.Anchored = true
  148. o.Parent = workspace
  149. o.Name = "Object"
  150. o.Reflectance = 0.5
  151. o.Transparency = 0.5
  152. o.Size = Vector3.new(4, 1.2, 4)
  153. o.CFrame = CFrame.new(0, -10, 0)
  154. end
  155. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement