Advertisement
Smorglees

Untitled

Jul 23rd, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.47 KB | None | 0 0
  1. game.workspace.xenocider613.Humanoid.MaxHealth = math.huge
  2. me = game.Players.xenocider613.Character.Torso
  3. name = "Xeno's Machine"
  4. mainpos = Vector3.new(me.Position.X + 10,0.3,me.Position.Z)
  5. maxdist = 7
  6. imgs = {"http://www.roblox.com/asset/?id=43267871","http://www.roblox.com/asset/?id=43267737",
  7. "http://www.roblox.com/asset/?id=43267826","http://www.roblox.com/asset/?id=43267704",
  8. "http://www.roblox.com/asset/?id=43267858"}
  9.  
  10. a = imgs[1]
  11. b = imgs[2]
  12. c = imgs[3]
  13. d = imgs[4]
  14. e = imgs[5]
  15.  
  16. give = true
  17. function givestats(player)
  18. local stat = Instance.new("IntValue")
  19. stat.Name = "leaderstats"
  20. local tix = Instance.new("IntValue")
  21. tix.Name = "Tix"
  22. tix.Value = 25
  23. tix.Parent = stat
  24. stat.Parent = player
  25. end
  26. for _,v in pairs(game.Players:GetPlayers()) do
  27. if v:findFirstChild("leaderstats") == nil then
  28. givestats(v)
  29. end
  30. end
  31. game.Players.PlayerAdded:connect(function(plyr) if give then givestats(plyr) end end)
  32.  
  33. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  34. part.Parent = parent
  35. part.formFactor = form
  36. part.CanCollide = collide
  37. part.Transparency = tran
  38. part.Reflectance = ref
  39. part.Size = Vector3.new(x,y,z)
  40. part.BrickColor = BrickColor.new(color)
  41. part.TopSurface = 0
  42. part.BottomSurface = 0
  43. part.Anchored = anchor
  44. part.Locked = true
  45. part:BreakJoints()
  46. end
  47.  
  48. function weld(w, p, p1, a, b, c, x, y, z)
  49. w.Parent = p
  50. w.Part0 = p
  51. w.Part1 = p1
  52. w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
  53. end
  54.  
  55. dings = {}
  56.  
  57. function getplyr(pos)
  58. local dist = maxdist
  59. local plyr = nil
  60. for _,v in pairs(game.Players:GetPlayers()) do
  61. if v.Character ~= nil then
  62. local to = v.Character:findFirstChild("Torso")
  63. if to ~= nil then
  64. if (to.Position - pos).magnitude < dist then
  65. dist = (to.Position - pos).magnitude
  66. plyr = v
  67. end
  68. end
  69. end
  70. end
  71. return plyr
  72. end
  73.  
  74. function reward(first,second,third,mod,pos,play)
  75. local k = 0
  76. if first.Texture == a and second.Texture == a and third.Texture == a then
  77. k = 3
  78. elseif first.Texture == b and second.Texture == b and third.Texture == b then
  79. k = 5
  80. elseif first.Texture == c and second.Texture == c and third.Texture == c then
  81. k = 8
  82. elseif first.Texture == d and second.Texture == d and third.Texture == d then
  83. k = 25
  84. elseif first.Texture == e and second.Texture == e and third.Texture == e then
  85. k = 75
  86. elseif first.Texture == d and second.Texture == d or third.Texture == d and second.Texture == d or third.Texture == d and first.Texture == d then
  87. k = 14
  88. elseif first.Texture == e and second.Texture == e or third.Texture == e and second.Texture == e or third.Texture == e and first.Texture == e then
  89. k = 35
  90. end
  91. for i=1,k do
  92. wait()
  93. local t = Instance.new("Part")
  94. prop(t, mod, true, 0, 0, 0.6, 0.1, 0.3, "Bright yellow", false, "Custom")
  95. t.CFrame = CFrame.new(pos + Vector3.new(math.random(-100,100)/100,0,math.random(-50,50)/100)) * CFrame.Angles(0,math.random(-32,32)/10,0)
  96. local dec = Instance.new("Decal",t)
  97. dec.Face = "Top"
  98. dec.Texture = "http://www.roblox.com/asset/?id=42602113"
  99. local de2 = dec:clone()
  100. de2.Parent = t
  101. de2.Face = "Bottom"
  102. local de = true
  103. coroutine.resume(coroutine.create(function()
  104. wait(23)
  105. t:remove()
  106. end))
  107. t.Touched:connect(function(hit)
  108. if de then
  109. if hit.Parent.Name == play.Name then
  110. local sta = play:findFirstChild("leaderstats")
  111. if sta ~= nil then
  112. local tx = sta:findFirstChild("Tix")
  113. if tx ~= nil then
  114. de = false
  115. tx.Value = tx.Value + 1
  116. t:remove()
  117. end
  118. end
  119. end
  120. end
  121. end)
  122. end
  123. end
  124.  
  125. local lol = workspace:findFirstChild(name)
  126. if lol ~= nil then
  127. lol:remove()
  128. end
  129.  
  130. machine = Instance.new("Model",workspace.Base)
  131. machine.Name = name
  132.  
  133. mainpart = Instance.new("Part")
  134. prop(mainpart,machine,true,0,0,5.7,9,5.1,"Bright red",true,"Custom")
  135. mainpart.CFrame = CFrame.new(mainpos) * CFrame.new(0,mainpart.Size.Y/2,0)
  136.  
  137. dec1 = Instance.new("Part")
  138. prop(dec1,machine,true,0,0,5,9.1,4.3,"Black",true,"Custom")
  139. dec1.CFrame = mainpart.CFrame
  140.  
  141. dec2 = Instance.new("Part")
  142. prop(dec2,machine,true,0,0,5,8.4,5.2,"Black",true,"Custom")
  143. dec2.CFrame = mainpart.CFrame
  144.  
  145. dec3 = Instance.new("Part")
  146. prop(dec3,machine,true,0,0,5.8,8.4,4.3,"Black",true,"Custom")
  147. dec3.CFrame = mainpart.CFrame
  148.  
  149. vend1 = Instance.new("Part")
  150. prop(vend1,machine,true,0,0,1.8,1.8,1.8,"Bright red",true,"Custom")
  151. vend1.CFrame = mainpart.CFrame * CFrame.new(-3.2,0,1.2)
  152. Instance.new("SpecialMesh",vend1).MeshType = "Sphere"
  153.  
  154. vend2 = Instance.new("Part")
  155. prop(vend2,machine,true,0,0,0.7,3.5,0.7,"Black",true,"Custom")
  156. vend2.CFrame = vend1.CFrame * CFrame.new(-0.3,2.3,0)
  157. Instance.new("SpecialMesh",vend2)
  158.  
  159. vend3 = Instance.new("Part")
  160. prop(vend3,machine,true,0,0,1.3,1.3,1.3,"Bright red",true,"Custom")
  161. vend3.CFrame = vend2.CFrame * CFrame.new(0,1.8,0)
  162. Instance.new("SpecialMesh",vend3).MeshType = "Sphere"
  163.  
  164. click = Instance.new("ClickDetector",vend1)
  165. click.MaxActivationDistance = maxdist
  166. click.Name = "ClickHere"
  167. abletoclick = true
  168.  
  169. for i=-180,-70,15 do
  170. local part = Instance.new("Part")
  171. prop(part,machine,false,0,0,3,0.4,0.1,"Black",true,"Custom")
  172. part.CFrame = mainpart.CFrame * CFrame.new(1.1,-1,2.8) * CFrame.Angles(math.rad(i),0,0) * CFrame.new(0,0,-1)
  173. table.insert(dings,part)
  174. for o=-1.5,1.5,3 do
  175. local part2 = Instance.new("Part")
  176. prop(part2,machine,false,0,0,0.1,0.4,1.2,"Bright red",true,"Custom")
  177. part2.CFrame = part.CFrame * CFrame.new(o,0,part2.Size.Z/2)
  178. end
  179. end
  180.  
  181. things = {}
  182. for i= -1.5, 1.5, 1.5 do
  183. local thing1 = Instance.new("Part")
  184. prop(thing1,machine,true,0,0,1.5,1,1.5,"White",true,"Custom")
  185. thing1.CFrame = mainpart.CFrame * CFrame.new(i,2,2.3) * CFrame.Angles(0,0,-math.pi/2)
  186. Instance.new("CylinderMesh",thing1)
  187. local dec = Instance.new("Decal",thing1)
  188. dec.Face = "Back"
  189. dec.Texture = imgs[1]
  190. table.insert(things,thing1)
  191. end
  192. on = things[1]
  193. sec = things[2]
  194. thi = things[3]
  195.  
  196. click.MouseClick:connect(function()
  197. if abletoclick == true then
  198. local player = getplyr(vend1.Position)
  199. if player ~= nil then
  200. local sta = player:findFirstChild("leaderstats")
  201. if sta ~= nil then
  202. local tc = sta:findFirstChild("Tix")
  203. if tc ~= nil then
  204. tc.Value = tc.Value - 4
  205. end
  206. end
  207. if abletoclick == true then
  208. abletoclick = false
  209. local bp = Instance.new("BodyPosition",player.Character.Torso)
  210. local to = bp.Parent
  211. local larm = to:findFirstChild("Left Shoulder")
  212. bp.P = 15000
  213. bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  214. bp.position = mainpart.CFrame * CFrame.new(-2,-1,4).p
  215. local bg = Instance.new("BodyGyro",player.Character.Torso)
  216. bg.P = 15000
  217. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  218. bg.cframe = CFrame.new(to.Position, vend1.Position - Vector3.new(0,0.8,0))
  219. wait(0.4)
  220. bg.cframe = CFrame.new(to.Position, vend1.Position - Vector3.new(0,0.8,0))
  221. local orig = nil
  222. if larm ~= nil then
  223. orig = larm.C0
  224. for i=0, 3, 0.4 do
  225. larm.C0 = orig * CFrame.fromEulerAnglesXYZ(0,0,-i)
  226. wait()
  227. end
  228. wait(0.1)
  229. else
  230. wait(0.2)
  231. end
  232. for i=0, 1.3, 0.15 do
  233. wait()
  234. vend2.CFrame = vend1.CFrame * CFrame.Angles(i,0,0) * CFrame.new(-0.3,2.3,0)
  235. vend3.CFrame = vend2.CFrame * CFrame.new(0,1.8,0)
  236. if larm ~= nil then
  237. larm.C0 = larm.C0 * CFrame.fromEulerAnglesXYZ(0,0,0.3)
  238. end
  239. end
  240. if larm ~= nil then
  241. larm.C0 = orig
  242. end
  243. wait(0.2)
  244. for i=1.3, 0, -0.3 do
  245. wait()
  246. vend2.CFrame = vend1.CFrame * CFrame.Angles(i,0,0) * CFrame.new(-0.3,2.3,0)
  247. vend3.CFrame = vend2.CFrame * CFrame.new(0,1.8,0)
  248. end
  249. bp.position = mainpart.CFrame * CFrame.new(0,-1,5.5).p
  250. bg.cframe = CFrame.new(to.Position, mainpart.Position)
  251. coroutine.resume(coroutine.create(function()
  252. wait(0.6)
  253. bg.cframe = CFrame.new(to.Position, mainpart.Position)
  254. end))
  255. for o=1,math.random(60,160) do
  256. local he = math.random(1,5)
  257. local he1 = math.random(1,5)
  258. local he2 = math.random(1,5)
  259. on.Decal.Texture = imgs[he]
  260. sec.Decal.Texture = imgs[he1]
  261. thi.Decal.Texture = imgs[he2]
  262. wait()
  263. end
  264. reward(on.Decal,sec.Decal,thi.Decal,machine,mainpart.CFrame * CFrame.new(1.1,-0.9,3).p,player)
  265. bp:remove()
  266. bg:remove()
  267. wait(1)
  268. abletoclick = true
  269. end
  270. end
  271. end
  272. end)
  273.  
  274. game.Players.xenocider613.Chatted:connect(function(msg)
  275. if msg == "leader" then
  276. give = false
  277. for _,v in pairs(game.Players:GetPlayers()) do
  278. if v:findFirstChild("leaderstats") ~= nil then
  279. v.leaderstats:remove()
  280. end
  281. end
  282. end
  283. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement