Advertisement
ClockworkHorror

Tetris Game

Aug 7th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.57 KB | None | 0 0
  1. name = "koolzion"
  2.  
  3. me = game.Players[name]
  4.  
  5.  
  6.  
  7. if script.Parent.className ~= "HopperBin" then
  8.  
  9. local hoppa = Instance.new("HopperBin")
  10.  
  11. hoppa.Parent = me.Backpack
  12.  
  13. hoppa.Name = "Play"
  14.  
  15. script.Parent = hoppa
  16.  
  17. end
  18.  
  19.  
  20.  
  21. sp = script.Parent
  22.  
  23.  
  24.  
  25. screen = Instance.new("ScreenGui")
  26.  
  27. screen.Parent = me.PlayerGui
  28.  
  29. screen.Name = "Tetris"
  30.  
  31.  
  32.  
  33. modes = {"Block", "Long", "Zright", "Zleft", "Lright", "Lleft"}
  34.  
  35.  
  36.  
  37. go = false
  38.  
  39. down = false
  40.  
  41.  
  42.  
  43. function onEquipped(mouse,key)
  44.  
  45. k = Instance.new("Frame")
  46.  
  47. k.Parent = screen
  48.  
  49. k.Size = UDim2.new(1,0,1.5,0)
  50.  
  51. k.Position = UDim2.new(0,0,0,-20)
  52.  
  53. k.BackgroundColor3 = Color3.new(0,0,0)
  54.  
  55. p = Instance.new("ImageLabel")
  56.  
  57. p.Parent = screen
  58.  
  59. p.Size = UDim2.new(0,300,0,116)
  60.  
  61. p.Position = UDim2.new(0,400,0,300)
  62.  
  63. p.Image = ""
  64.  
  65. p.BackgroundColor3 = Color3.new(0,0,0)
  66.  
  67. p.BackgroundTransparency = 1
  68.  
  69. sp.Parent = nil
  70.  
  71. for i=1, 5 do
  72.  
  73. wait(0.2)
  74.  
  75. p.Image = "http://www.roblox.com/asset/?id=40448297"
  76.  
  77. wait(0.2)
  78.  
  79. p.Image = ""
  80.  
  81. end
  82.  
  83. wait(1)
  84.  
  85. d = Instance.new("Frame")
  86.  
  87. d.Parent = screen
  88.  
  89. d.Size = UDim2.new(0,200,0,400)
  90.  
  91. d.Position = UDim2.new(0,400,0,150)
  92.  
  93. d.BackgroundColor3 = Color3.new(0.12,0.12,0.12)
  94.  
  95. d.BorderColor3 = Color3.new(1,1,0)
  96.  
  97. d.BackgroundTransparency = 1
  98.  
  99. bu = Instance.new("TextButton")
  100.  
  101. bu.Parent = screen
  102.  
  103. bu.Size = UDim2.new(0,190,0,70)
  104.  
  105. bu.Position = UDim2.new(0,405,0,200)
  106.  
  107. bu.Text = "Start game"
  108.  
  109. bu.FontSize = "Size18"
  110.  
  111. bu.BackgroundTransparency = 1
  112.  
  113. bu.BackgroundColor3 = Color3.new(0.1,0.1,0.2)
  114.  
  115. bu.BorderColor3 = Color3.new(1,1,0)
  116.  
  117. bu.TextColor3 = Color3.new(1,1,0)
  118.  
  119. for i=1, 30 do
  120.  
  121. wait()
  122.  
  123. d.BackgroundTransparency = d.BackgroundTransparency - 0.034
  124.  
  125. bu.BackgroundTransparency = bu.BackgroundTransparency - 0.034
  126.  
  127. end
  128.  
  129. bu.MouseButton1Click:connect(function()
  130.  
  131. for i=1, 5 do
  132.  
  133. bu.BackgroundTransparency = bu.BackgroundTransparency + 0.2
  134.  
  135. wait()
  136.  
  137. end
  138.  
  139. f = Instance.new("Frame")
  140.  
  141. f.Parent = d
  142.  
  143. f.Position = UDim2.new(0,100,0,0)
  144.  
  145. f.Size = UDim2.new(0,20,0,20)
  146.  
  147. bu:remove()
  148.  
  149. pos1 = 0
  150.  
  151. pos2 = 0
  152.  
  153. pos3 = 0
  154.  
  155. pos4 = 0
  156.  
  157. go = true
  158.  
  159. while go == true do
  160.  
  161. local modenum = math.random(1,2)
  162.  
  163. if modenum == 1 then
  164.  
  165. local br = Instance.new("Frame")
  166.  
  167. br.Parent = d
  168.  
  169. br.Size = UDim2.new(0,20,0,20)
  170.  
  171. br.Position = f.Position
  172.  
  173. br.BackgroundColor3 = Color3.new(1,1,0)
  174.  
  175. br.BorderColor3 = Color3.new(0,0,0)
  176.  
  177. local brr1 = Instance.new("Frame")
  178.  
  179. brr1.Parent = br
  180.  
  181. brr1.Size = UDim2.new(0,20,0,20)
  182.  
  183. brr1.Position = UDim2.new(0,0,0,20)
  184.  
  185. brr1.BackgroundColor3 = Color3.new(1,1,0)
  186.  
  187. brr1.BorderColor3 = Color3.new(0,0,0)
  188.  
  189. local brr2 = Instance.new("Frame")
  190.  
  191. brr2.Parent = br
  192.  
  193. brr2.Size = UDim2.new(0,20,0,20)
  194.  
  195. brr2.Position = UDim2.new(0,20,0,20)
  196.  
  197. brr2.BackgroundColor3 = Color3.new(1,1,0)
  198.  
  199. brr2.BorderColor3 = Color3.new(0,0,0)
  200.  
  201. local brr3 = Instance.new("Frame")
  202.  
  203. brr3.Parent = br
  204.  
  205. brr3.Size = UDim2.new(0,20,0,20)
  206.  
  207. brr3.Position = UDim2.new(0,20,0,0)
  208.  
  209. brr3.BackgroundColor3 = Color3.new(1,1,0)
  210.  
  211. brr3.BorderColor3 = Color3.new(0,0,0)
  212.  
  213. local pow = true
  214.  
  215. mouse.KeyDown:connect(function(key)
  216.  
  217. if pow == true then
  218.  
  219. key = key:lower()
  220.  
  221. if key == "h" then
  222.  
  223. if br.Position.X.Offset == 160 then return end
  224.  
  225. br.Position = br.Position + UDim2.new(0,20,0,0)
  226.  
  227. elseif key == "f" then
  228.  
  229. if br.Position.X.Offset == 0 then return end
  230.  
  231. br.Position = br.Position + UDim2.new(0,-20,0,0)
  232.  
  233. end
  234.  
  235. end
  236.  
  237. end)
  238.  
  239. down = true
  240.  
  241. while down == true do
  242.  
  243. wait(0.5)
  244.  
  245. if br.Position.Y.Offset == 340 then
  246.  
  247. down = false
  248.  
  249. pow = false
  250.  
  251. end
  252.  
  253. br.Position = br.Position + UDim2.new(0,0,0,20)
  254.  
  255. end
  256.  
  257. elseif modenum == 2 then
  258.  
  259. local brt = Instance.new("Frame")
  260.  
  261. brt.Parent = d
  262.  
  263. brt.Size = UDim2.new(0,20,0,20)
  264.  
  265. brt.Position = f.Position
  266.  
  267. brt.BackgroundColor3 = Color3.new(0.1,0.1,1)
  268.  
  269. brt.BorderColor3 = Color3.new(0,0,0)
  270.  
  271. local brrt1 = Instance.new("Frame")
  272.  
  273. brrt1.Parent = brt
  274.  
  275. brrt1.Size = UDim2.new(0,20,0,20)
  276.  
  277. brrt1.Position = UDim2.new(0,20,0,0)
  278.  
  279. brrt1.BackgroundColor3 = Color3.new(0.1,0.1,1)
  280.  
  281. brrt1.BorderColor3 = Color3.new(0,0,0)
  282.  
  283. local brrt2 = Instance.new("Frame")
  284.  
  285. brrt2.Parent = brt
  286.  
  287. brrt2.Size = UDim2.new(0,20,0,20)
  288.  
  289. brrt2.Position = UDim2.new(0,-20,0,0)
  290.  
  291. brrt2.BackgroundColor3 = Color3.new(0.1,0.1,1)
  292.  
  293. brrt2.BorderColor3 = Color3.new(0,0,0)
  294.  
  295. local brrt3 = Instance.new("Frame")
  296.  
  297. brrt3.Parent = brt
  298.  
  299. brrt3.Size = UDim2.new(0,20,0,20)
  300.  
  301. brrt3.Position = UDim2.new(0,-20,0,-20)
  302.  
  303. brrt3.BackgroundColor3 = Color3.new(0.1,0.1,1)
  304.  
  305. brrt3.BorderColor3 = Color3.new(0,0,0)
  306.  
  307. local pow = true
  308.  
  309. mouse.KeyDown:connect(function(key)
  310.  
  311. if pow == true then
  312.  
  313. key = key:lower()
  314.  
  315. if key == "h" then
  316.  
  317. if brt.Position.X.Offset == 160 then return end
  318.  
  319. brt.Position = brt.Position + UDim2.new(0,20,0,0)
  320.  
  321. elseif key == "f" then
  322.  
  323. if brt.Position.X.Offset == 20 then return end
  324.  
  325. brt.Position = brt.Position + UDim2.new(0,-20,0,0)
  326.  
  327. end
  328.  
  329. end
  330.  
  331. end)
  332.  
  333. down = true
  334.  
  335. while down == true do
  336.  
  337. wait(0.5)
  338.  
  339. if brt.Position.Y.Offset == 360 then
  340.  
  341. down = false
  342.  
  343. pow = false
  344.  
  345. end
  346.  
  347. brt.Position = brt.Position + UDim2.new(0,0,0,20)
  348.  
  349. end
  350.  
  351. end
  352.  
  353. wait(1)
  354.  
  355. end
  356.  
  357. end)
  358.  
  359. end
  360.  
  361.  
  362.  
  363. sp.Selected:connect(onEquipped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement