Advertisement
Guest User

Roblox Coffee Machine Script TEST1

a guest
Aug 17th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.77 KB | None | 0 0
  1. -- This is made for Void Script Builder! The creator is GAM3RBOY2008!
  2. local model = Instance.new("Model", workspace)
  3. local base = Instance.new("Part", model)
  4. local side = Instance.new("Part", model)
  5. local top = Instance.new("Part", model)
  6. local light = Instance.new("Part", model)
  7. local pointlight = Instance.new("PointLight", light)
  8. local screen = Instance.new("Part", model)
  9. local gui = Instance.new("SurfaceGui", screen)
  10. local hole = Instance.new("Part", model)
  11. model.Name = "CoffeeVendingMachine"
  12. base.Anchored = true
  13. base.Name = "Base"
  14. base.Size = Vector3.new(4.5,8.37,2.25)
  15. base.Position = base.Position + Vector3.new(0,4,0)
  16. base.BrickColor = BrickColor.new("Reddish brown")
  17. base.Material = "WoodPlanks"
  18. base.CastShadow = false
  19. side.Name = "Left"
  20. side.Anchored = true
  21. side.CanCollide = false
  22. side.Size = Vector3.new(0.625, 8.375, 4.5)
  23. side.Position = base.Position + Vector3.new(2.5,0,0)
  24. side.BrickColor = BrickColor.new("Lily white")
  25. local right = side:Clone()
  26. right.Name = "Right"
  27. right.Parent = model
  28. right.Position = base.Position - Vector3.new(2.5,0,0)
  29. top.Name = "Top"
  30. top.Anchored = true
  31. top.Size = Vector3.new(5.65, 0.625, 4.5)
  32. top.Position = base.Position + Vector3.new(0,4.5,0)
  33. top.BrickColor = BrickColor.new("Lily white")
  34. top.TopSurface = "Smooth"
  35. top.BottomSurface = "Smooth"
  36. top.CastShadow = false
  37. light.Name = "Light"
  38. light.Anchored = true
  39. light.Size = Vector3.new(4, 0.5, 1.5)
  40. light.Position = top.Position + Vector3.new(0,-.1,-1.25)
  41. light.Material = "Neon"
  42. pointlight.Brightness = 1.5
  43. pointlight.Range = 13
  44. hole.Name = "Hole"
  45. hole.Anchored = true
  46. hole.Size = Vector3.new(1.39, 1.77, 0.05)
  47. hole.Position = screen.Position - Vector3.new(-1,-2,1.25)
  48. hole.Transparency = 1
  49. local holedecal = Instance.new("Decal", hole)
  50. holedecal.Name = "Hole Decal"
  51. holedecal.Texture = "rbxassetid://226014391"
  52. holedecal.Face = "Front"
  53. local sidedecalpart = right:Clone()
  54. sidedecalpart.Name = "Side Decal / Text"
  55. sidedecalpart.Parent = model
  56. sidedecalpart.Size = Vector3.new(0.625, 7.345, 3.25)
  57. sidedecalpart.Position = right.Position + Vector3.new(-0.11,-0.515,-0.065)
  58. sidedecalpart.Transparency = 1
  59. sidedecalpart.CanCollide = false
  60. local sidedecal = Instance.new("Decal", sidedecalpart)
  61. sidedecal.Face = "Left"
  62. sidedecal.Texture = "http://www.roblox.com/asset/?id=3668600312"
  63. local sidetext = Instance.new("SurfaceGui", sidedecalpart)
  64. sidetext.Face = "Left"
  65. local sidetextlabel = Instance.new("TextLabel", sidetext)
  66. sidetextlabel.Font = "Arcade"
  67. sidetextlabel.Text = "Coffee Machine Script by GAM3RBOY2008"
  68. sidetextlabel.TextScaled = true
  69. sidetextlabel.Size = UDim2.new(0,800,0,200)
  70. sidetextlabel.BackgroundTransparency = 1
  71. sidetextlabel.BorderSizePixel = 0
  72. screen.Name = "Screen"
  73. screen.Anchored = true
  74. screen.Transparency = 1
  75. screen.CastShadow = false
  76. screen.Size = Vector3.new(3.5, 3, 1.5)
  77. screen.Position = base.Position - Vector3.new(0,-1.7,0.5)
  78. local backlight = Instance.new("Frame", gui)
  79. backlight.Size = UDim2.new(0, 800,0, 600)
  80. gui.Name = "Screen-Gui"
  81. gui.LightInfluence = 25
  82. local clicktostart = Instance.new("TextButton", backlight)
  83. clicktostart.Font = "SourceSans"
  84. clicktostart.Size = UDim2.new(0, 800,0, 600)
  85. clicktostart.BackgroundTransparency = 1
  86. clicktostart.Text = "Click To Start!"
  87. clicktostart.TextScaled = true
  88. clicktostart.TextColor3 = Color3.new(0,0,0)
  89. local coffeetype_Cappuccino = Instance.new("TextButton", backlight)
  90. coffeetype_Cappuccino.Font = "SourceSans"
  91. coffeetype_Cappuccino.TextColor3 = Color3.new(0,0,0)
  92. coffeetype_Cappuccino.Name = "TypeCappuccino"
  93. coffeetype_Cappuccino.Size = UDim2.new(0,400,0,600)
  94. coffeetype_Cappuccino.BorderSizePixel = 0
  95. coffeetype_Cappuccino.TextScaled = true
  96. coffeetype_Cappuccino.Text = "Cappuccino"
  97. coffeetype_Cappuccino.Visible = false
  98. local coffeetype_Black = coffeetype_Cappuccino:Clone()
  99. coffeetype_Black.Font = "SourceSans"
  100. coffeetype_Black.Parent = backlight
  101. coffeetype_Black.Text = "Black Coffee"
  102. coffeetype_Black.Position = UDim2.new(0,400,0,0)
  103. coffeetype_Black.Visible = false
  104. local coffeetype_label = Instance.new("TextLabel", backlight)
  105. coffeetype_label.Font = "SourceSans"
  106. coffeetype_label.Name = "LabelType"
  107. coffeetype_label.TextColor3 = Color3.new(0,0,0)
  108. coffeetype_label.Size = UDim2.new(0,800,0,100)
  109. coffeetype_label.BorderSizePixel = 0
  110. coffeetype_label.TextScaled = true
  111. coffeetype_label.Text = "Choose a Coffee Type"
  112. coffeetype_label.Visible = false
  113. local coffee_load = Instance.new("ImageLabel", backlight)
  114. coffee_load.Size = UDim2.new(0,400,0,800)
  115. coffee_load.Name = "Brewing"
  116. coffee_load.Image = "http://www.roblox.com/asset/?id=3668600312"
  117. coffee_load.BackgroundTransparency = 1
  118. coffee_load.Position = UDim2.new(0,200,0,-125)
  119. coffee_load.Visible = false
  120. local coffee_load_label = Instance.new("TextLabel",backlight)
  121. coffee_load_label.Font = "SourceSans"
  122. coffee_load_label.Name = "BrewingLabel"
  123. coffee_load_label.Size = UDim2.new(0,800,0,100)
  124. coffee_load_label.TextScaled = true
  125. coffee_load_label.TextColor3 = Color3.new(0,0,0)
  126. coffee_load_label.BorderSizePixel = 0
  127. coffee_load_label.BackgroundTransparency = 1
  128. coffee_load_label.Text = "Brewing your coffee..."
  129. coffee_load_label.Visible = false
  130. local enjoy_label = Instance.new("TextLabel", backlight)
  131. enjoy_label.Font = "SourceSans"
  132. enjoy_label.Name = "EnjoyLabel"
  133. enjoy_label.Size = UDim2.new(0, 800,0, 600)
  134. enjoy_label.BackgroundTransparency = 1
  135. enjoy_label.Text = "Enjoy your coffee!"
  136. enjoy_label.TextScaled = true
  137. enjoy_label.TextColor3 = Color3.new(0,0,0)
  138. enjoy_label.Visible = false
  139.  
  140.  
  141. -- SCRIPTING!!!
  142.  
  143. clicktostart.MouseButton1Click:Connect(function()
  144. clicktostart.Visible = false
  145. coffeetype_label.Visible = true
  146. coffeetype_Cappuccino.Visible = true
  147. coffeetype_Black.Visible = true
  148. end)
  149.  
  150. coffeetype_Cappuccino.MouseButton1Click:Connect(function()
  151. coffeetype_Cappuccino.Visible = false
  152. coffeetype_Black.Visible = false
  153. coffeetype_label.Visible = false
  154. coffee_load.Visible = true
  155. coffee_load_label.Visible = true
  156. for i = 1,100 do
  157. coffee_load.Rotation = coffee_load.Rotation + 5
  158. wait(0.01)
  159. end
  160. MakeCap()
  161. coffee_load.Rotation = 0
  162. coffee_load.Visible = false
  163. coffee_load_label.Visible = false
  164. enjoy_label.Visible = true
  165. wait(3)
  166. enjoy_label.Visible = false
  167. clicktostart.Visible = true
  168. end)
  169.  
  170. coffeetype_Black.MouseButton1Click:Connect(function()
  171. coffeetype_Cappuccino.Visible = false
  172. coffeetype_Black.Visible = false
  173. coffeetype_label.Visible = false
  174. coffee_load.Visible = true
  175. coffee_load_label.Visible = true
  176. for i = 1,100 do
  177. coffee_load.Rotation = coffee_load.Rotation + 5
  178. wait(0.01)
  179. end
  180. MakeBlack()
  181. coffee_load.Rotation = 0
  182. coffee_load.Visible = false
  183. coffee_load_label.Visible = false
  184. enjoy_label.Visible = true
  185. wait(3)
  186. enjoy_label.Visible = false
  187. clicktostart.Visible = true
  188. end)
  189.  
  190. function MakeBlack()
  191. local tool = Instance.new("Tool", workspace)
  192. local handle = Instance.new("Part", tool)
  193. local mesh = Instance.new("SpecialMesh", handle)
  194. local coffee
  195. local cmesh
  196. local weld
  197. local cdecal
  198. local enabled = true
  199. tool.Name = "Cup Of Black Coffee"
  200. tool.ToolTip = "mmm.. Tasty!"
  201. local torso = findTorso(base.Position)
  202. if torso ~= nil then
  203. handle.CFrame = torso.CFrame
  204. end
  205. handle.Name = "Handle"
  206. handle.BrickColor = BrickColor.new("Institutional white")
  207. mesh.Name = "m"
  208. mesh.MeshType = "FileMesh"
  209. mesh.MeshId="http://www.roblox.com/asset/?id=32023686"
  210. mesh.Scale = Vector3.new(1.325, 1.325, 1.325)
  211. coffee = handle:Clone()
  212. coffee.Name = "Brown"
  213. coffee.Parent = handle
  214. cdecal = Instance.new("Decal", coffee)
  215. cdecal.Texture = "rbxassetid://38053293"
  216. cdecal.Face = "Top"
  217. weld = Instance.new("Weld",coffee)
  218. weld.Part0 = handle
  219. weld.Part1 = coffee
  220. coffee.CanCollide = false
  221. coffee.Size = Vector3.new(0.883, 0.353, 1.767)
  222. coffee.m:Destroy()
  223. cmesh = Instance.new("CylinderMesh", coffee)
  224. cmesh.Offset = Vector3.new(-0.15,-0,0)
  225. cmesh.Scale = Vector3.new(0.7, 1.75, 0.65)
  226. handle.Touched:Connect(function(hit)
  227. if enabled == false then return end
  228. if hit.Parent:FindFirstChild("Humanoid") then
  229. tool.Parent = game.Players:FindFirstChild(hit.Parent.Name).Backpack
  230. end
  231. end)
  232. end
  233.  
  234. function MakeCap()
  235. local tool = Instance.new("Tool", workspace)
  236. local handle = Instance.new("Part", tool)
  237. local mesh = Instance.new("SpecialMesh", handle)
  238. local coffee
  239. local cmesh
  240. local weld
  241. local cdecal
  242. local enabled = true
  243. tool.Name = "Cup Of Cappuccino"
  244. tool.ToolTip = "mmm.. Tasty!"
  245. local torso = findTorso(base.Position)
  246. if torso ~= nil then
  247. handle.CFrame = torso.CFrame
  248. end
  249. handle.Name = "Handle"
  250. handle.BrickColor = BrickColor.new("Institutional white")
  251. mesh.Name = "m"
  252. mesh.MeshType = "FileMesh"
  253. mesh.MeshId="http://www.roblox.com/asset/?id=32023686"
  254. mesh.Scale = Vector3.new(1.325, 1.325, 1.325)
  255. coffee = handle:Clone()
  256. coffee.Name = "Brown"
  257. coffee.Parent = handle
  258. cdecal = Instance.new("Decal", coffee)
  259. cdecal.Texture = "rbxassetid://322384913"
  260. cdecal.Face = "Top"
  261. weld = Instance.new("Weld",coffee)
  262. weld.Part0 = handle
  263. weld.Part1 = coffee
  264. coffee.CanCollide = false
  265. coffee.Size = Vector3.new(0.883, 0.353, 1.767)
  266. coffee.m:Destroy()
  267. cmesh = Instance.new("CylinderMesh", coffee)
  268. cmesh.Offset = Vector3.new(-0.15,-0,0)
  269. cmesh.Scale = Vector3.new(0.7, 1.75, 0.65)
  270. handle.Touched:Connect(function(hit)
  271. if enabled == false then return end
  272. if hit.Parent:FindFirstChild("Humanoid") then
  273. tool.Parent = game.Players:FindFirstChild(hit.Parent.Name).Backpack
  274. end
  275. end)
  276. end
  277.  
  278. function findTorso(pos)
  279. local torso = nil
  280. local dist = 75
  281. local child = workspace:children()
  282. for i=1, #child do
  283. if child[i].className == "Model" then
  284. local h = child[i]:findFirstChild("Humanoid")
  285. if h ~= nil then
  286. local check = child[i]:findFirstChild("Torso")
  287. if check ~= nil then
  288. if (check.Position - pos).magnitude < dist then
  289. torso = check
  290. dist = (check.Position - pos).magnitude
  291. end
  292. end
  293. end
  294. end
  295. end
  296. return torso
  297. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement