Advertisement
spacemonkey3591

Moving 3D Gui

Jun 15th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.51 KB | None | 0 0
  1.  
  2. local runDummyScript = function(f,scri)
  3. local oldenv = getfenv(f)
  4. local newenv = setmetatable({}, {
  5. __index = function(_, k)
  6. if k:lower() == 'script' then
  7. return scri
  8. else
  9. return oldenv[k]
  10. end
  11. end
  12. })
  13. setfenv(f, newenv)
  14. ypcall(function() f() end)
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. mas.Name = "CompiledModel"
  19. o1 = Instance.new("ScreenGui")
  20. o2 = Instance.new("Frame")
  21. o3 = Instance.new("Frame")
  22. o4 = Instance.new("Frame")
  23. o5 = Instance.new("Frame")
  24. o6 = Instance.new("Frame")
  25. o7 = Instance.new("Frame")
  26. o8 = Instance.new("Frame")
  27. o9 = Instance.new("Frame")
  28. o10 = Instance.new("Frame")
  29. o11 = Instance.new("Frame")
  30. o12 = Instance.new("Frame")
  31. o13 = Instance.new("Frame")
  32. o14 = Instance.new("Frame")
  33. o15 = Instance.new("Frame")
  34. o16 = Instance.new("Frame")
  35. o17 = Instance.new("Frame")
  36. o18 = Instance.new("Frame")
  37. o19 = Instance.new("Frame")
  38. o20 = Instance.new("Frame")
  39. o21 = Instance.new("Frame")
  40. o22 = Instance.new("Frame")
  41. o23 = Instance.new("Frame")
  42. o24 = Instance.new("Frame")
  43. o25 = Instance.new("Frame")
  44. o26 = Instance.new("Frame")
  45. o27 = Instance.new("Frame")
  46. o28 = Instance.new("Frame")
  47. o29 = Instance.new("Frame")
  48. o30 = Instance.new("Script")
  49. o1.Name = "CubeGui"
  50. o1.Parent = game.Players.LocalPlayer.PlayerGui
  51. o2.Name = "Cube"
  52. o2.Parent = o1
  53. o2.Position = UDim2.new(0,0,0,-1)
  54. o2.Size = UDim2.new(1,-1,1,-1)
  55. o2.Position = UDim2.new(0,0,0,-1)
  56. o2.BackgroundTransparency = 1
  57. o3.Name = "U1"
  58. o3.Parent = o2
  59. o3.Position = UDim2.new(0,13,0,147)
  60. o3.Size = UDim2.new(0,52,0,52)
  61. o3.Position = UDim2.new(0,13,0,147)
  62. o3.BackgroundColor3 = Color3.new(0.890196, 0.890196, 0.890196)
  63. o3.BorderColor3 = Color3.new(0, 0, 0.4)
  64. o3.BorderSizePixel = 0
  65. o3.ZIndex = 6
  66. o4.Name = "U26"
  67. o4.Parent = o2
  68. o4.Position = UDim2.new(0,295,0,262)
  69. o4.Size = UDim2.new(0,26,0,26)
  70. o4.Position = UDim2.new(0,295,0,262)
  71. o4.BackgroundColor3 = Color3.new(0.45098, 0.45098, 0.45098)
  72. o4.BorderColor3 = Color3.new(0, 0, 0.4)
  73. o4.BorderSizePixel = 0
  74. o4.ZIndex = 3
  75. o5.Name = "U27"
  76. o5.Parent = o2
  77. o5.Position = UDim2.new(0,243,0,212)
  78. o5.Size = UDim2.new(0,12,0,12)
  79. o5.Position = UDim2.new(0,243,0,212)
  80. o5.BackgroundColor3 = Color3.new(0.203922, 0.203922, 0.203922)
  81. o5.BorderColor3 = Color3.new(0, 0, 0.4)
  82. o5.BorderSizePixel = 0
  83. o6.Name = "U2"
  84. o6.Parent = o2
  85. o6.Position = UDim2.new(0,65,0,113)
  86. o6.Size = UDim2.new(0,38,0,38)
  87. o6.Position = UDim2.new(0,65,0,113)
  88. o6.BackgroundColor3 = Color3.new(0.643137, 0.643137, 0.643137)
  89. o6.BorderColor3 = Color3.new(0, 0, 0.4)
  90. o6.BorderSizePixel = 0
  91. o6.ZIndex = 4
  92. o7.Name = "U3"
  93. o7.Parent = o2
  94. o7.Position = UDim2.new(0,117,0,116)
  95. o7.Size = UDim2.new(0,23,0,23)
  96. o7.Position = UDim2.new(0,117,0,116)
  97. o7.BackgroundColor3 = Color3.new(0.392157, 0.392157, 0.392157)
  98. o7.BorderColor3 = Color3.new(0, 0, 0.4)
  99. o7.BorderSizePixel = 0
  100. o7.ZIndex = 2
  101. o8.Name = "U4"
  102. o8.Parent = o2
  103. o8.Position = UDim2.new(0,173,0,121)
  104. o8.Size = UDim2.new(0,53,0,53)
  105. o8.Position = UDim2.new(0,173,0,121)
  106. o8.BackgroundColor3 = Color3.new(0.909804, 0.909804, 0.909804)
  107. o8.BorderColor3 = Color3.new(0, 0, 0.4)
  108. o8.BorderSizePixel = 0
  109. o8.ZIndex = 6
  110. o9.Name = "U5"
  111. o9.Parent = o2
  112. o9.Position = UDim2.new(0,180,0,92)
  113. o9.Size = UDim2.new(0,39,0,39)
  114. o9.Position = UDim2.new(0,180,0,92)
  115. o9.BackgroundColor3 = Color3.new(0.662745, 0.662745, 0.662745)
  116. o9.BorderColor3 = Color3.new(0, 0, 0.4)
  117. o9.BorderSizePixel = 0
  118. o9.ZIndex = 4
  119. o10.Name = "U6"
  120. o10.Parent = o2
  121. o10.Position = UDim2.new(0,188,0,101)
  122. o10.Size = UDim2.new(0,24,0,24)
  123. o10.Position = UDim2.new(0,188,0,101)
  124. o10.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  125. o10.BorderColor3 = Color3.new(0, 0, 0.4)
  126. o10.BorderSizePixel = 0
  127. o10.ZIndex = 3
  128. o11.Name = "U7"
  129. o11.Parent = o2
  130. o11.Position = UDim2.new(0,339,0,94)
  131. o11.Size = UDim2.new(0,54,0,54)
  132. o11.Position = UDim2.new(0,339,0,94)
  133. o11.BackgroundColor3 = Color3.new(0.929412, 0.929412, 0.929412)
  134. o11.BorderColor3 = Color3.new(0, 0, 0.4)
  135. o11.BorderSizePixel = 0
  136. o11.ZIndex = 6
  137. o12.Name = "U8"
  138. o12.Parent = o2
  139. o12.Position = UDim2.new(0,302,0,70)
  140. o12.Size = UDim2.new(0,40,0,40)
  141. o12.Position = UDim2.new(0,302,0,70)
  142. o12.BackgroundColor3 = Color3.new(0.678431, 0.678431, 0.678431)
  143. o12.BorderColor3 = Color3.new(0, 0, 0.4)
  144. o12.BorderSizePixel = 0
  145. o12.ZIndex = 4
  146. o13.Name = "U9"
  147. o13.Parent = o2
  148. o13.Position = UDim2.new(0,265,0,84)
  149. o13.Size = UDim2.new(0,25,0,25)
  150. o13.Position = UDim2.new(0,265,0,84)
  151. o13.BackgroundColor3 = Color3.new(0.431373, 0.431373, 0.431373)
  152. o13.BorderColor3 = Color3.new(0, 0, 0.4)
  153. o13.BorderSizePixel = 0
  154. o13.ZIndex = 3
  155. o14.Name = "U10"
  156. o14.Parent = o2
  157. o14.Position = UDim2.new(0,60,0,281)
  158. o14.Size = UDim2.new(0,45,0,45)
  159. o14.Position = UDim2.new(0,60,0,281)
  160. o14.BackgroundColor3 = Color3.new(0.776471, 0.776471, 0.776471)
  161. o14.BorderColor3 = Color3.new(0, 0, 0.4)
  162. o14.BorderSizePixel = 0
  163. o14.ZIndex = 5
  164. o15.Name = "U11"
  165. o15.Parent = o2
  166. o15.Position = UDim2.new(0,105,0,214)
  167. o15.Size = UDim2.new(0,31,0,31)
  168. o15.Position = UDim2.new(0,105,0,214)
  169. o15.BackgroundColor3 = Color3.new(0.529412, 0.529412, 0.529412)
  170. o15.BorderColor3 = Color3.new(0, 0, 0.4)
  171. o15.BorderSizePixel = 0
  172. o15.ZIndex = 3
  173. o16.Name = "U12"
  174. o16.Parent = o2
  175. o16.Position = UDim2.new(0,150,0,186)
  176. o16.Size = UDim2.new(0,16,0,16)
  177. o16.Position = UDim2.new(0,150,0,186)
  178. o16.BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431)
  179. o16.BorderColor3 = Color3.new(0, 0, 0.4)
  180. o16.BorderSizePixel = 0
  181. o16.ZIndex = 2
  182. o17.Name = "U13"
  183. o17.Parent = o2
  184. o17.Position = UDim2.new(0,200,0,261)
  185. o17.Size = UDim2.new(0,47,0,47)
  186. o17.Position = UDim2.new(0,200,0,261)
  187. o17.BackgroundColor3 = Color3.new(0.796079, 0.796079, 0.796079)
  188. o17.BorderColor3 = Color3.new(0, 0, 0.4)
  189. o17.BorderSizePixel = 0
  190. o17.ZIndex = 5
  191. o18.Name = "U14"
  192. o18.Parent = o2
  193. o18.Position = UDim2.new(0,200,0,200)
  194. o18.Size = UDim2.new(0,32,0,32)
  195. o18.Position = UDim2.new(0,200,0,200)
  196. o18.BackgroundColor3 = Color3.new(0.54902, 0.54902, 0.54902)
  197. o18.BorderColor3 = Color3.new(0, 0, 0.4)
  198. o18.BorderSizePixel = 0
  199. o18.ZIndex = 4
  200. o19.Name = "U15"
  201. o19.Parent = o2
  202. o19.Position = UDim2.new(0,200,0,177)
  203. o19.Size = UDim2.new(0,17,0,17)
  204. o19.Position = UDim2.new(0,200,0,177)
  205. o19.BackgroundColor3 = Color3.new(0.298039, 0.298039, 0.298039)
  206. o19.BorderColor3 = Color3.new(0, 0, 0.4)
  207. o19.BorderSizePixel = 0
  208. o19.ZIndex = 2
  209. o20.Name = "U16"
  210. o20.Parent = o2
  211. o20.Position = UDim2.new(0,347,0,240)
  212. o20.Size = UDim2.new(0,48,0,48)
  213. o20.Position = UDim2.new(0,347,0,240)
  214. o20.BackgroundColor3 = Color3.new(0.815686, 0.815686, 0.815686)
  215. o20.BorderColor3 = Color3.new(0, 0, 0.4)
  216. o20.BorderSizePixel = 0
  217. o20.ZIndex = 5
  218. o21.Name = "U17"
  219. o21.Parent = o2
  220. o21.Position = UDim2.new(0,302,0,184)
  221. o21.Size = UDim2.new(0,33,0,33)
  222. o21.Position = UDim2.new(0,302,0,184)
  223. o21.BackgroundColor3 = Color3.new(0.564706, 0.564706, 0.564706)
  224. o21.BorderColor3 = Color3.new(0, 0, 0.4)
  225. o21.BorderSizePixel = 0
  226. o21.ZIndex = 4
  227. o22.Name = "U18"
  228. o22.Parent = o2
  229. o22.Position = UDim2.new(0,257,0,167)
  230. o22.Size = UDim2.new(0,19,0,19)
  231. o22.Position = UDim2.new(0,257,0,167)
  232. o22.BackgroundColor3 = Color3.new(0.317647, 0.317647, 0.317647)
  233. o22.BorderColor3 = Color3.new(0, 0, 0.4)
  234. o22.BorderSizePixel = 0
  235. o22.ZIndex = 2
  236. o23.Name = "U19"
  237. o23.Parent = o2
  238. o23.Position = UDim2.new(0,101,0,377)
  239. o23.Size = UDim2.new(0,39,0,39)
  240. o23.Position = UDim2.new(0,101,0,377)
  241. o23.BackgroundColor3 = Color3.new(0.662745, 0.662745, 0.662745)
  242. o23.BorderColor3 = Color3.new(0, 0, 0.4)
  243. o23.BorderSizePixel = 0
  244. o23.ZIndex = 4
  245. o24.Name = "U20"
  246. o24.Parent = o2
  247. o24.Position = UDim2.new(0,138,0,279)
  248. o24.Size = UDim2.new(0,24,0,24)
  249. o24.Position = UDim2.new(0,138,0,279)
  250. o24.BackgroundColor3 = Color3.new(0.415686, 0.415686, 0.415686)
  251. o24.BorderColor3 = Color3.new(0, 0, 0.4)
  252. o24.BorderSizePixel = 0
  253. o24.ZIndex = 3
  254. o25.Name = "U21"
  255. o25.Parent = o2
  256. o25.Position = UDim2.new(0,175,0,219)
  257. o25.Size = UDim2.new(0,10,0,10)
  258. o25.Position = UDim2.new(0,175,0,219)
  259. o25.BackgroundColor3 = Color3.new(0.164706, 0.164706, 0.164706)
  260. o25.BorderColor3 = Color3.new(0, 0, 0.4)
  261. o25.BorderSizePixel = 0
  262. o26.Name = "U22"
  263. o26.Parent = o2
  264. o26.Position = UDim2.new(0,221,0,364)
  265. o26.Size = UDim2.new(0,40,0,40)
  266. o26.Position = UDim2.new(0,221,0,364)
  267. o26.BackgroundColor3 = Color3.new(0.682353, 0.682353, 0.682353)
  268. o26.BorderColor3 = Color3.new(0, 0, 0.4)
  269. o26.BorderSizePixel = 0
  270. o26.ZIndex = 4
  271. o27.Name = "U23"
  272. o27.Parent = o2
  273. o27.Position = UDim2.new(0,213,0,271)
  274. o27.Size = UDim2.new(0,25,0,25)
  275. o27.Position = UDim2.new(0,213,0,271)
  276. o27.BackgroundColor3 = Color3.new(0.431373, 0.431373, 0.431373)
  277. o27.BorderColor3 = Color3.new(0, 0, 0.4)
  278. o27.BorderSizePixel = 0
  279. o27.ZIndex = 3
  280. o28.Name = "U24"
  281. o28.Parent = o2
  282. o28.Position = UDim2.new(0,206,0,216)
  283. o28.Size = UDim2.new(0,11,0,11)
  284. o28.Position = UDim2.new(0,206,0,216)
  285. o28.BackgroundColor3 = Color3.new(0.184314, 0.184314, 0.184314)
  286. o28.BorderColor3 = Color3.new(0, 0, 0.4)
  287. o28.BorderSizePixel = 0
  288. o29.Name = "U25"
  289. o29.Parent = o2
  290. o29.Position = UDim2.new(0,347,0,349)
  291. o29.Size = UDim2.new(0,41,0,41)
  292. o29.Position = UDim2.new(0,347,0,349)
  293. o29.BackgroundColor3 = Color3.new(0.701961, 0.701961, 0.701961)
  294. o29.BorderColor3 = Color3.new(0, 0, 0.4)
  295. o29.BorderSizePixel = 0
  296. o29.ZIndex = 5
  297. o30.Parent = o2
  298. table.insert(cors,coroutine.create(function()
  299. wait()
  300. runDummyScript(function()
  301. --#Fl0x was here
  302. --[=[
  303. Feel free to edit and play around.
  304. A little credit for my work is appreciated.
  305. -Fl0x.
  306. ]=]
  307.  
  308. local dimension = 1
  309. local i = 27
  310.  
  311. function cube(a,b)
  312. i = 1
  313. for x = -dimension, dimension,dimension do
  314. for y = -dimension, dimension,dimension do
  315. for z = -dimension, dimension,dimension do
  316. local u = x
  317. local v = y
  318. local w = z
  319. local u2 = u * math.cos(a) - v * math.sin(a)
  320. local v2 = u * math.sin(a) + v * math.cos(a)
  321. local w2 = w
  322. u = u2
  323. v = v2
  324. w = w2
  325. u2 = u
  326. v2 = v * math.cos(b) - w * math.sin(b)
  327. w2 = v * math.sin(b) + w * math.cos(b)
  328. u = u2
  329. v = v2
  330. w = w2
  331. local c = math.floor((w + 2) * 70)
  332. if c < 0 then c = 0 end
  333. if c > 255 then c = 255 end
  334. s = script.Parent["U"..i]
  335. s.Position=UDim2.new(0,200 + u * (w + 2) * 50, 0, 200 + v * (w + 2) * 50)
  336. s.BackgroundColor3 = Color3.new(c/255, c/255, c/255)
  337. s.Size=UDim2.new(0,(w + 2) * 16,0,(w + 2) * 16)
  338. s.ZIndex = math.floor((w + 2) * 2)
  339. i=i+1
  340. end
  341. end
  342. end
  343. end
  344.  
  345. script.Parent.MouseMoved:connect(function(x,y)
  346. cube(x/99,y/99)
  347. end)
  348. end,o30)
  349. end))
  350. mas.Parent = workspace
  351. mas:MakeJoints()
  352. local mas1 = mas:GetChildren()
  353. for i=1,#mas1 do
  354. mas1[i].Parent = script
  355. ypcall(function() mas1[i]:MakeJoints() end)
  356. end
  357. mas:Destroy()
  358. for i=1,#cors do
  359. coroutine.resume(cors[i])
  360. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement