Advertisement
minwoo

Restaurant tycoon script

Apr 27th, 2019
16,331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.05 KB | None | 0 0
  1.  
  2. local items = {{"Glass Table (Blue)","aea"},{"BBQ","cgz"},{"Large Glass Table (Blue)","aga"},{"Chinese Clothed Table (White)","ahm"},{"Square Clothed Table (White)","aim"},{"Large Wood Table","aja"},{"Modern Chair (Blue)","aka"},{"Modern Chair (Black)","akk"},{"Modern Chair (White)","akm"},{"Basic Table","avz"},{"Low quality Counter","caa"},{"Average Counter","cba"},"High quality Counter","cca",{"Best quality Counter","cda"},{"Milkshake Bar","cez"},{"Hit Drinks Bar","cfz"},{"Catzario Statue","daz"},{"Mighty Statue","dbz"},{"Ultraw Statue","dcz"},{"DerpyMcDerpell Statue","ddz"},{"AtomixKing Statue","dez"},{"Kindoodle Statue","dfz"},{"Twenty-One Pilots (Premium Radio)","dgz"},{"Spanish (Premium Radio)","dhz"},{"Rap (Premium Radio)","djz"},{"Cyaim Statue","diz"},{"Blocksky Statue","dkz"},{"Tiki Smoothie Bar","dlz"},{"Welcome Chalkboard (Sand)","gbw"},{"Reeds","gjz"},{"Tall Lamp (Black)","gpk"},{"Tall Lamp (White)","gpm"},{"Food Signs","grz"},{"Boat","gsz"},{"Electronic Radio","maz"},{"Jazz Radio","mbz"},{"Cheerful Radio","mcz"},{"Electronic Dance DJ Table","mdz"},{"Japanese Arch","raz"},{"Italian Arch","rbz"},{"Golden Arch","rez"},{"TV","w2z"},{"Modern Shelf","w4z"},{"Blocksky Painting","woz"}}
  3. local gui = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
  4. local main = Instance.new("Frame",gui)
  5. local colours = Instance.new("Frame",main)
  6. local dark = Instance.new("Frame",colours)
  7. local logo = Instance.new("TextLabel",colours)
  8. local logodark = Instance.new("TextLabel",colours)
  9. local amount = Instance.new("TextBox",main)
  10. local amountdark = Instance.new("TextLabel",main)
  11. local give = Instance.new("TextButton",main)
  12. local darkgive = Instance.new('TextLabel',main)
  13. local infmon = Instance.new("TextButton",main)
  14. local darkinfmon = Instance.new("TextLabel",main)
  15. local infon = Instance.new("TextLabel",main)
  16. local infond = Instance.new("TextLabel",main)
  17. local on = Instance.new("TextLabel",main)
  18. local ond = Instance.new("TextLabel",main)
  19. local open = Instance.new("Frame",gui)
  20. local op = Instance.new("TextButton",open)
  21. local od = Instance.new("TextLabel",open)
  22. open.Size = UDim2.new(.069,0,.097,0)
  23. open.Position = UDim2.new(1-.069,0,1-.097,0)
  24. open.BackgroundColor3 = Color3.fromRGB(40,40,40)
  25. open.BackgroundTransparency = .35
  26. main.Position = UDim2.new(.303,0,-.496,0)
  27. open.BorderSizePixel = 0
  28. op.Size = UDim2.new(1,0,1,0)
  29. op.TextColor3 = Color3.fromRGB(0, 166, 255)
  30. op.BackgroundTransparency = 1
  31. op.TextScaled = true
  32. op.Text = "Open"
  33. op.ZIndex = 2
  34. od.Size = UDim2.new(1,0,1,0)
  35. od.TextColor3 = Color3.fromRGB(98,98,98)
  36. od.Position = UDim2.new(0,0,0.025,0)
  37. od.BackgroundTransparency = 1
  38. od.TextScaled = true
  39. od.Text = "Open"
  40. on.Size = UDim2.new(.377,0,.141,0)
  41. on.Position = UDim2.new(.74,0,.802,0)
  42. on.TextScaled = true
  43. on.Text = "off"
  44. on.BackgroundTransparency = 1
  45. on.TextColor3 = Color3.fromRGB(0,166,255)
  46. on.ZIndex = 2
  47. on.TextXAlignment = "Left"
  48. ond.Size = UDim2.new(.377,0,.141,0)
  49. ond.Position = UDim2.new(.74,0,.808,0)
  50. ond.TextScaled = true
  51. ond.Text = "off"
  52. ond.TextXAlignment = "Left"
  53. ond.BackgroundTransparency = 1
  54. ond.TextColor3 = Color3.fromRGB(98,98,98)
  55. infon.Size = UDim2.new(.377,0,.141,0)
  56. infon.Position = UDim2.new(.358,0,.802,0)
  57. infon.TextScaled = true
  58. infon.TextColor3 = Color3.fromRGB(0,166,255)
  59. infon.Text = "Infinite Money:"
  60. infon.BackgroundTransparency = 1
  61. infon.ZIndex = 2
  62. infond.Size = UDim2.new(.377,0,.141,0)
  63. infond.Position = UDim2.new(.358,0,.808,0)
  64. infond.TextScaled = true
  65. infond.TextColor3 = Color3.fromRGB(98,98,98)
  66. infond.Text = "Infinite Money:"
  67. infond.BackgroundTransparency = 1
  68. infmon.Size = UDim2.new(.608,0,.192,0)
  69. infmon.Position = UDim2.new(.358,0,.605,0)
  70. infmon.BackgroundTransparency = 1
  71. infmon.TextScaled = true
  72. infmon.TextColor3 = Color3.fromRGB(0,166,255)
  73. infmon.Text = "Toggle Infinite Money"
  74. infmon.ZIndex = 2
  75. darkinfmon.Size = UDim2.new(.608,0,.192,0)
  76. darkinfmon.Position = UDim2.new(.358,0,.61,0)
  77. darkinfmon.BackgroundTransparency = 1
  78. darkinfmon.TextScaled = true
  79. darkinfmon.TextColor3 = Color3.fromRGB(98,98,98)
  80. darkinfmon.Text = "Toggle Infinite Money"
  81. give.Size = UDim2.new(.377,0,.141,0)
  82. give.Position = UDim2.new(.358,0,.418,0)
  83. give.TextScaled = true
  84. give.Text = "Give Amount"
  85. give.BackgroundTransparency = 1
  86. give.TextColor3 = Color3.fromRGB(0,166,255)
  87. give.ZIndex = 2
  88. darkgive.Size = UDim2.new(.377,0,.141,0)
  89. darkgive.Position = UDim2.new(.358,0,.421,0)
  90. darkgive.TextScaled = true
  91. darkgive.Text = "Give Amount"
  92. darkgive.BackgroundTransparency = 1
  93. darkgive.TextColor3 = Color3.fromRGB(98,98,98)
  94. amount.Size = UDim2.new(.621,0,.15,0)
  95. amount.TextXAlignment = "Left"
  96. amount.Size = UDim2.new(.621,0,.15,0)
  97. amount.TextXAlignment = "Left"
  98. amount.BackgroundTransparency = 1
  99. amount.Position = UDim2.new(.358,0,.229,0)
  100. amount.TextScaled = true
  101. amount.TextColor3 = Color3.fromRGB(0,166,255)
  102. amount.Text = "Amount"
  103. amount.ZIndex = 2
  104. amountdark.Size = UDim2.new(.621,0,.15,0)
  105. amountdark.TextXAlignment = "Left"
  106. amountdark.BackgroundTransparency = 1
  107. amountdark.Position = UDim2.new(.358,0,.235,0)
  108. amountdark.TextScaled = true
  109. amountdark.TextColor3 = Color3.fromRGB(98,98,98)
  110. amountdark.Text = "Amount"
  111. frame = Instance.new("ScrollingFrame",main)
  112. main.BorderSizePixel = 0
  113. colours.BorderSizePixel = 0
  114. frame.Size = UDim2.new(.325,0,.8,0)
  115. frame.BackgroundTransparency = 1
  116. frame.Position = UDim2.new(0,0,0.2,0)
  117. frame.CanvasSize = UDim2.new(0,0,math.ceil((.8*#items)/5),0)
  118. main.Size = UDim2.new(0.404, 0,0.496, 0)
  119. main.BackgroundColor3 = Color3.fromRGB(40,40,40)
  120. main.BackgroundTransparency = .35
  121. colours.Size = UDim2.new(1,0,.2,0)
  122. colours.BackgroundColor3 = Color3.fromRGB(0, 166, 255)
  123. dark.Size = UDim2.new(1,0,.1,0)
  124. dark.BackgroundTransparency = .65
  125. dark.BorderSizePixel = 0
  126. dark.BackgroundColor3 = Color3.fromRGB(107,107,107)
  127. dark.Position = UDim2.new(0,0,0.9,0)
  128. gui.Name = "MjrGaelic's GUI"
  129. logo.Text = "MjrGaelic's GUI"
  130. logo.BackgroundTransparency = 1
  131. logo.TextScaled = true
  132. logo.Size = UDim2.new(.498,0,.648,0)
  133. logo.TextColor3 = Color3.fromRGB(255,255,255)
  134. logo.Position = UDim2.new(.251,0,.166,0)
  135. logo.ZIndex = 2
  136. logodark.Text = "MjrGaelic's GUI"
  137. logodark.BackgroundTransparency = 1
  138. logodark.TextScaled = true
  139. logodark.Size =UDim2.new(.498,0,.648,0)
  140. logodark.TextColor3 = Color3.fromRGB(98,98,98)
  141. logodark.Position = UDim2.new(.251,0,.2,0)
  142. op.MouseButton1Click:connect(function()
  143. if op.Text == "Open" then
  144. op.Text = "Close"
  145. od.Text ="Close"
  146. main:TweenPosition(UDim2.new(.303,0,.252,0),"InOut","Quart",.33)
  147. else
  148. op.Text = "Open"
  149. od.Text = "Open"
  150. main:TweenPosition(UDim2.new(.303,0,-.496,-36),"InOut","Quart",.33)
  151. end
  152. end)
  153. --
  154. local factory
  155. for _,tycoon in pairs(game.Workspace.Tycoons:GetChildren()) do
  156. if tycoon.Factory.Player.Value == game.Players.LocalPlayer then
  157. factory = tycoon.Factory
  158. end
  159. end
  160. local lastCounter
  161. factory.PlacedItems.Finished.ChildAdded:Connect(function(obj)
  162. if obj.Name == "Counter5" then
  163. lastCounter = obj
  164. end
  165. end)
  166. function da()
  167. while true do
  168. if on.Text == "on" then
  169. game.Workspace.Events.ItemPurchase:InvokeServer(0,"cgz",0)
  170. game.Workspace.Events.Building.PlaceObject:InvokeServer({Workspace.Furniture.Counter5,false,Vector3.new(0,-10,0),90,"cgz"})
  171. factory.RestaurantHandler.RemoveFurniture:InvokeServer(lastCounter,3)
  172. end
  173. wait(.01)
  174. end
  175. end
  176. spawn(da)
  177. --
  178. give.MouseButton1Click:connect(function()
  179. local ez = ""
  180. for i,v in pairs(frame:GetChildren()) do
  181. if v.Sel.Value == true then
  182. ez = v.Item.Value
  183. break
  184. end
  185. end
  186. for i = 1,tonumber(amount.Text) do
  187. game.Workspace.Events.ItemPurchase:InvokeServer(0, ez, 0)
  188. wait(.1)
  189. end
  190. end)
  191. infmon.MouseButton1Click:connect(function()
  192. if on.Text == "off" then
  193. on.Text = "on"
  194. ond.Text = "on"
  195. else
  196. on.Text = "off"
  197. ond.Text = "off"
  198. end
  199. end)
  200. local lasgood = 1
  201. amount.Changed:connect(function()
  202. if tonumber(amount.Text) == nil then
  203. if amount.Text == "" then
  204. amount.Text = "1"
  205. lasgood = 1
  206. else
  207. amount.Text = tostring(lasgood)
  208. end
  209. else
  210. if tonumber(amount.Text) > 99 then
  211. amount.Text = "99"
  212. end
  213. lasgood = amount.text
  214. end
  215. amountdark.Text = amount.Text
  216. end)
  217. for i,v in pairs(items) do
  218. if tostring(v[1]) ~= nil then
  219. local new = Instance.new("Frame",frame)
  220. local li = Instance.new("TextButton",new)
  221. local da = Instance.new("TextLabel",new)
  222. local sel = Instance.new("BoolValue",new)
  223. local val = Instance.new("StringValue",new)
  224. val.Name = "Item"
  225. val.Value = tostring(v[2])
  226. sel.Name = "Sel"
  227. sel.Value = false
  228. new.Size = UDim2.new(.925,0,.2/frame.CanvasSize.Y.Scale,0)
  229. new.BackgroundColor3 = Color3.fromRGB(0,166,255)
  230. new.BorderColor3 = Color3.fromRGB(0,0,0)
  231. if i ~= 1 then
  232. new.Position = UDim2.new(0,0,((.2/frame.CanvasSize.Y.Scale)*i)-(.2/frame.CanvasSize.Y.Scale),1)
  233. end
  234. li.Size = UDim2.new(1,0,1,0)
  235. li.TextScaled = true
  236. li.TextColor3 = Color3.fromRGB(255,255,255)
  237. li.BackgroundTransparency = 1
  238. li.ZIndex = 2
  239. li.Text = tostring(v[1])
  240. sel.Changed:connect(function()
  241. if sel.Value == true then
  242. new.BackgroundColor3 = Color3.fromRGB(0,0,0)
  243. da.TextColor3 = Color3.fromRGB(0,166,255)
  244. else
  245. da.TextColor3 = Color3.fromRGB(98,98,98)
  246. li.TextColor3 = Color3.fromRGB(255,255,255)
  247. new.BackgroundColor3 = Color3.fromRGB(0,166,255)
  248. end
  249. end)
  250. da.Size = UDim2.new(1,0,1,0)
  251. da.TextScaled = true
  252. da.TextColor3 = Color3.fromRGB(98,98,98)
  253. da.BackgroundTransparency = 1
  254. da.Text = tostring(v[1])
  255. da.Position = UDim2.new(0,0,0.025,0)
  256. li.MouseButton1Click:connect(function()
  257. for i,v in pairs(frame:GetChildren()) do
  258. v.Sel.Value = false
  259. end
  260. sel.Value = true
  261. end)
  262. end
  263. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement