Advertisement
Scriptorz5

pelikone

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