Guest User

script

a guest
May 20th, 2018
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.55 KB | None | 0 0
  1. bin=script.Parent
  2. selected = nil
  3. s = script.Parent.Parent.Parent
  4. tar = nil
  5. mess = nil
  6. e = nil
  7. top = ""
  8. option = false
  9. options = 0
  10. targey = nil
  11.  
  12. --give raise
  13. --take raise
  14. --make employee of the day
  15. --send home
  16. --send to spawn
  17.  
  18.  
  19.  
  20.  
  21. house = {"a1","a2","a3","b1","b2","b3","c1","c2","c3"}
  22. r = {"Hello, I would like to order a Pepperoni pizza.", "I'm going to have a Cheese pizza deliverd", "I want a Sausage Pizza","I guess I will get a Mountain Dew"}
  23. message = Instance.new("Message")
  24. message.Parent = s.Character
  25.  
  26. force = Instance.new("SelectionBox")
  27. force.Parent = message
  28. script.force.Value = force
  29.  
  30.  
  31. --script.Parent.TextureId = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=" .. string.lower(script.parent.parent.parent.Name)
  32.  
  33.  
  34.  
  35.  
  36. function icony(mouse)
  37. local size = mouse.ViewSizeY
  38. local threeOp = {size / 5, (size / 5 + size/5), (size / 5 + size/5)+ size /5,(size / 5 + size/5)+ (size/5+size/5),size}
  39. if mouse.Y <= threeOp[1] then
  40. options = 1
  41. elseif mouse.Y <= threeOp[2] then
  42. options = 2
  43. elseif mouse.Y <= threeOp[3] then
  44. options = 3
  45. elseif mouse.Y <= threeOp[4] then
  46. options = 4
  47. elseif mouse.Y <= threeOp[5] then
  48. options = 5
  49. end
  50. end
  51.  
  52.  
  53.  
  54.  
  55. function sitDown()
  56. if script.Parent.Person.Value == nil then return end
  57. local g = game.Workspace:GetChildren()
  58. for i = 1,#g do
  59. if g[i].Name == "CustomerDis" and g[i].Torso.Transparency == 1 then
  60.  
  61. g[i].Torso.BrickColor = script.Parent.Person.Value.Torso.BrickColor
  62. g[i].Head.BrickColor = script.Parent.Person.Value.Head.BrickColor
  63. g[i]["Right Arm"].BrickColor = script.Parent.Person.Value["Right Arm"].BrickColor
  64. g[i]["Left Arm"].BrickColor = script.Parent.Person.Value["Left Arm"].BrickColor
  65. g[i]["Left Leg"].BrickColor = script.Parent.Person.Value["Left Leg"].BrickColor
  66. g[i]["Right Leg"].BrickColor = script.Parent.Person.Value["Right Leg"].BrickColor
  67. local s = script.Script:clone()
  68. s.Disabled = false
  69. s.Parent = g[i]
  70. return
  71. end
  72. end
  73.  
  74. end
  75.  
  76.  
  77.  
  78. function deliver(mouse)
  79. if mouse.Target.Name == "FullBox" then
  80. local y = game.Lighting.Storage.Pizza:clone()
  81. y.Name = "To: " .. string.upper(mouse.Target.House.Value)
  82. y.Parent = script.Parent.Parent.Parent.Backpack
  83. y.House.Value = mouse.Target.House.Value
  84. mouse.Target:remove()
  85. script.Parent.Step:Play()
  86. wait(0.2)
  87. script.Parent.Step:Stop()
  88. end
  89. if mouse.Target.Name == "MountainDew" then
  90. local yy = game.Lighting.Storage.MountainDew:clone()
  91. yy.Name = "To: " .. string.upper(mouse.Target.House.Value)
  92. yy.Parent = script.Parent.Parent.Parent.Backpack
  93. yy.House.Value = mouse.Target.House.Value
  94. mouse.Target:remove()
  95. script.Parent.Step:Play()
  96. wait(0.2)
  97. script.Parent.Step:Stop()
  98. end
  99. end
  100.  
  101.  
  102.  
  103.  
  104. function cook(mouse)
  105. if mouse.Target.Name == "Dough" and top ~= "" then
  106. st = game.Workspace.Items
  107. if top == "Sausage1" and mouse.Target.Topping.Value ~= 1 and mouse.Target.Topping.Value ~= 2 and st.Sausage.Value ~= 0 then
  108. mouse.Target.Owner.Value = script.Parent.Parent.Parent
  109. game.Lighting.Storage.Sausage:clone().Parent = mouse.Target
  110. mouse.Target.Topping.Value = 2
  111. st.Sausage.Value = st.Sausage.Value - 1
  112. script.Parent.Splat:Play()
  113.  
  114. elseif top == "Pepperoni1" and mouse.Target.Topping.Value ~= 1 and mouse.Target.Topping.Value ~= 2 and st.Pepperoni.Value ~= 0 then
  115. game.Lighting.Storage.Pepperoni:clone().Parent = mouse.Target
  116. mouse.Target.Topping.Value = 1
  117. mouse.Target.Owner.Value = script.Parent.Parent.Parent
  118. st.Pepperoni.Value = st.Pepperoni.Value - 1
  119. script.Parent.Splat:Play()
  120.  
  121. elseif top == "Cheese1" and mouse.Target.Cheese.Value ~= true and st.Cheese.Value ~= 0 then
  122. game.Lighting.Storage.Cheese:clone().Parent = mouse.Target
  123. mouse.Target.Cheese.Value = true
  124. mouse.Target.Owner.Value = script.Parent.Parent.Parent
  125. st.Cheese.Value = st.Cheese.Value - 1
  126. script.Parent.Splat:Play()
  127.  
  128. elseif top == "TomatoSauce1" and mouse.Target.TomatoSauce.Value ~= true and st.TomatoSauce.Value ~= 0 then
  129. game.Lighting.Storage.TomatoSauce:clone().Parent = mouse.Target
  130. mouse.Target.TomatoSauce.Value = true
  131. mouse.Target.Owner.Value = script.Parent.Parent.Parent
  132. st.TomatoSauce.Value = st.TomatoSauce.Value - 1
  133. script.Parent.Splat:Play()
  134. end
  135.  
  136. end
  137. if mouse.Target.Name == "Sausage1" or mouse.Target.Name == "Pepperoni1" or mouse.Target.Name == "Cheese1" or mouse.Target.Name == "TomatoSauce1" then
  138. top = mouse.Target.Name
  139. local targ = mouse.Target
  140. targ.BrickColor = BrickColor.new(21)
  141. wait()
  142. targ.BrickColor = BrickColor.new(1)
  143. end
  144. end
  145.  
  146.  
  147.  
  148.  
  149.  
  150. function find()
  151. local g = game.Workspace.Customers:GetChildren()
  152. return g[math.random(1,#g)]
  153. end
  154. ab = nil
  155.  
  156. function phone(mouseTarget)
  157.  
  158. if mouseTarget.Parent.Name == "Phone" and mouseTarget.Parent.Ringing.Value == true and mouseTarget.Parent.Order.Value == false then
  159. e = find()
  160. mess = Instance.new("Hint")
  161. mess.Text = r[e.Value]
  162. mess.Parent = script.Parent.Parent.Parent.PlayerGui
  163. script.Parent.Person.Value = e
  164. mode = 2
  165. mouseTarget.Parent.Ringing.Value = false
  166. elseif mouseTarget.Parent.Name == "Phone" and mouseTarget.Parent.Ringing.Value == true and mouseTarget.Parent.Order.Value == true then
  167. human = true
  168. ab = mouseTarget.Parent.House.Value
  169. e = game.Workspace.Customers.Cheese
  170. mess = Instance.new("Hint")
  171. mess.Text = mouseTarget.Parent.Customer.Value .. " wants a cheese pizza"
  172. mess.Parent = script.Parent.Parent.Parent
  173. script.Parent.Person.Value = e
  174. mode = 2
  175. mouseTarget.Parent.Ringing.Value = false
  176. mouseTarget.Parent.Order.Value = false
  177.  
  178.  
  179. end
  180.  
  181. if mouseTarget.Parent.Name == "Register" and mode == 2 and script.Parent.Person.Value ~= nil then
  182. if mouseTarget.Value.Value == e.Value then
  183.  
  184. local gy = mouseTarget:FindFirstChild(mouseTarget.Name)
  185. if gy ~= nil then
  186. tar = mouseTarget
  187. tar.Parent.Screen.Ding:Play()
  188. local f = Instance.new("Decal")
  189. f.Texture = gy.Texture
  190. f.Name = gy.Name
  191. f.Face = "Front"
  192. f.Parent = game.Workspace.Orders.Storage
  193. s.Cashier.Value = script.Parent.Parent.Parent.Cashier.Value + 1
  194.  
  195. local h = Instance.new("StringValue")
  196. if human == false then
  197. h.Value = house[math.random(1,#house)]
  198. elseif human == true then
  199. h.Value = ab
  200. end
  201. h.Name = "House"
  202. h.Parent = f
  203.  
  204. mess.Parent = nil
  205. script.Parent.Person.Value = nil
  206. tar.BrickColor = BrickColor.new(21)
  207. wait()
  208. tar.BrickColor = BrickColor.new(194)
  209. end
  210. end
  211. end
  212. end
  213.  
  214.  
  215.  
  216.  
  217. function register(mouseTarget)
  218. local r = mouseTarget.Parent:FindFirstChild("Say")
  219. if r ~= nil then
  220. r.Parent.Name = r.Value
  221. script.Parent.Person.Value = mouseTarget.Parent
  222. mode = 1
  223. end
  224.  
  225. if mouseTarget.Parent.Name == "Register" and mode == 1 then
  226. if script.Parent.Person.Value ~= nil then
  227. if mouseTarget.Value.Value == script.Parent.Person.Value.Order.Value then
  228. local g = mouseTarget:FindFirstChild(mouseTarget.Name)
  229. if g ~= nil then
  230. tar = mouseTarget
  231. tar.Parent.Screen.Ding:Play()
  232.  
  233. local f = Instance.new("Decal")
  234. f.Texture = g.Texture
  235. f.Name = g.Name
  236. f.Face = "Front"
  237. f.Parent = game.Workspace.Orders.Storage
  238. mode = 1
  239. s.Cashier.Value = s.Cashier.Value + 1
  240.  
  241. local h = Instance.new("StringValue")
  242. h.Value = script.Parent.Person.Value.House.Value
  243. h.Name = "House"
  244. h.Parent = f
  245.  
  246. local y = script.Parent.Person.Value.Lane.Value
  247. if y == 1 then
  248. game.Workspace.Lane1.OCC.Value = false
  249. elseif y == 2 then
  250. game.Workspace.Lane2.OCC.Value = false
  251. end
  252. if script.Parent.Person.Value:FindFirstChild("Seat") == nil then
  253. sitDown()
  254. end
  255. script.Parent.Person.Value.Parent = nil
  256. script.Parent.Person.Value = nil
  257.  
  258. tar.BrickColor = BrickColor.new(21)
  259. wait()
  260. tar.BrickColor = BrickColor.new(194)
  261. end
  262. end
  263. end
  264. end
  265. end
  266. tot = nil
  267.  
  268.  
  269.  
  270. function order(mouse)
  271. if mouse.Target.Parent.Name == "Telephone" and mouse.Target.Parent.Parent.Parent.Owner.Value == script.Parent.Parent.Parent and mouse.Target.Parent.Parent.Parent:FindFirstChild("Order") == nil then
  272. if game.Workspace.Phone.Order.Value == false then
  273. game.Workspace.Phone.Order.Value = true
  274. game.Workspace.Phone.Ringing.Value = true
  275. workspace.Phone.House.Value = mouse.Target.Parent.Parent.Parent.House.Value
  276. workspace.Phone.Customer.Value = s.Name
  277. local t = Instance.new("ObjectValue")
  278. t.Name = "Order"
  279. t.Parent = mouse.Target.Parent.Parent.Parent
  280. local ty = script.Scripty:clone()
  281. ty.Disabled = false
  282. ty.Parent = t
  283. end
  284. end
  285. end
  286.  
  287.  
  288.  
  289.  
  290.  
  291. function onMove(mouse)
  292. if mouse.Target == nil then return end
  293. if mouse.Target ~= tot then
  294. force.Parent = nil
  295. force.Adornee = nil
  296. end
  297.  
  298. if option == true then
  299. icony(mouse)
  300. return
  301. end
  302.  
  303.  
  304. --[[if selected ~= nil then
  305. pos = mouse.Hit.p
  306. x = pos.x
  307. y = pos.y
  308. z = pos.z
  309. if mouse.Target ~= selected then
  310. selected.CFrame = mouse.Target.CFrame
  311. end
  312. selected.Position = Vector3.new(math.ceil(x)-(math.ceil(selected.Size.x/2)-selected.Size.x/2),y-1.2,math.ceil(z)-(math.ceil(selected.Size.z/2)-selected.Size.z/2))
  313. end]]
  314.  
  315. if selected ~= nil then return end
  316.  
  317.  
  318.  
  319. if mouse.Target.Locked == false and selected == nil or
  320. mouse.Target.Size == Vector3.new(4,1.2,4) and s.TeamColor == BrickColor.new(24) or
  321. mouse.Target.Parent.Name == "Register" and s.TeamColor == BrickColor.new(21) or
  322. mouse.Target:FindFirstChild("Refill") ~= nil and s.TeamColor == BrickColor.new(1) then
  323.  
  324. force.Parent = mouse.Target
  325. force.Adornee = mouse.Target
  326. tot = mouse.Target
  327. mouse.Icon = "rbxasset://textures\\DragCursor.png"
  328. return
  329. end
  330.  
  331.  
  332.  
  333.  
  334. if mouse.Target.Parent.Name == "Phone" and s.TeamColor == BrickColor.new(21) or
  335. mouse.Target.Parent:FindFirstChild("Lane") ~= nil and s.TeamColor == BrickColor.new(21) or
  336. mouse.Target.Parent:FindFirstChild("Humanoid") ~= nil and game.Players:GetPlayerFromCharacter(mouse.Target.Parent) ~= nil and s.TeamColor == BrickColor.new(28) or
  337. mouse.Target.Parent.Name == "Telephone" and mouse.Target.Parent.Parent.Parent.Owner.Value == script.Parent.Parent.Parent then
  338.  
  339. force.Parent = mouse.Target.Parent
  340. force.Adornee = mouse.Target.Parent
  341. tot = mouse.Target
  342. mouse.Icon = "rbxasset://textures\\DragCursor.png"
  343. return
  344. else
  345. mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
  346.  
  347. end
  348. end
  349.  
  350. --if s.TeamColor == BrickColor.new(23) then
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359. --[[function onButton1Up(mouse)
  360. if selected ~= nil then
  361.  
  362. selected.Parent = game.Workspace
  363. selected.Anchored = false
  364. wait()
  365. selected.Velocity = Vector3.new(1,0,0)
  366. selected.Position = Vector3.new(math.ceil(x)-(math.ceil(selected.Size.x/2)-selected.Size.x/2),y-1.2,math.ceil(z)-(math.ceil(selected.Size.z/2)-selected.Size.z/2))
  367. if selected:FindFirstChild("Refill") ~= nil then
  368. selected:MakeJoints()
  369. end
  370. selected = nil
  371. mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
  372. end
  373. end]]
  374.  
  375.  
  376. raiseDe = false
  377. homeDe = false
  378. spawnDe = false
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385. function onButton1Down(mouse)
  386. if mouse.Target == nil then return end
  387.  
  388. if mouse.Target.Parent:FindFirstChild("Humanoid") ~= nil and game.Players:GetPlayerFromCharacter(mouse.Target.Parent) ~= nil and option == false and s.TeamColor == BrickColor.new(28) then
  389. option = true
  390. targey = game.Players:GetPlayerFromCharacter(mouse.Target.Parent)
  391. return
  392. end
  393. if option == true and targey ~= nil then
  394. option = false
  395. if options == 1 and raiseDe == false then
  396. targey.leaderstats.Money.Value = targey.leaderstats.Money.Value + 30
  397. targey.Raise.Value = targey.Raise.Value + 1
  398. script.Parent.Parent.Parent.leaderstats.Money.Value = script.Parent.Parent.Parent.leaderstats.Money.Value - 5
  399. raiseDe = true
  400. wait(10)
  401. raiseDe = false
  402. return
  403.  
  404. elseif options == 2 and targey.Raise.Value ~= 0 then
  405. targey.leaderstats.Money.Value = targey.leaderstats.Money.Value - 30
  406. targey.Raise.Value = targey.Raise.Value - 1
  407. s.leaderstats.Money.Value = s.leaderstats.Money.Value + 5
  408. return
  409.  
  410. elseif options == 3 then
  411. game.Workspace.EOD.Value = targey
  412. return
  413.  
  414. elseif options == 4 and homeDe == false then
  415. local g = game.Workspace:GetChildren()
  416. for i = 1,#g do
  417. if g[i].Name == "House" and g[i].Owner.Value == targey then
  418. targey.Character:MoveTo(g[i].Spawn.Position)
  419. end
  420. end
  421. homeDe = true
  422. wait(60)
  423. homeDe = false
  424. return
  425. elseif options == 5 and spawnDe == false then
  426. local g = game.Workspace:GetChildren()
  427. for i = 1,#g do
  428. if g[i].className == "SpawnLocation" then
  429. if g[i].BrickColor == targey.TeamColor then
  430. targey.Character:MoveTo(g[i].Position)
  431. end
  432. end
  433. end
  434. spawnDe = true
  435. wait(30)
  436. spawnDe = false
  437. return
  438. end
  439. end
  440.  
  441.  
  442.  
  443. ------------------------------------------------------------------------------
  444.  
  445. if s.TeamColor == BrickColor.new(21) then
  446. register(mouse.Target)
  447. phone(mouse.Target)
  448.  
  449. end
  450. if s.TeamColor == BrickColor.new(24) then
  451. cook(mouse)
  452. end
  453.  
  454. if mouse.Target.Name == "MountainDew" or mouse.Target.Name == "FullBox" then
  455. if s.TeamColor == BrickColor.new(23) then
  456. deliver(mouse)
  457. end
  458. end
  459.  
  460. if mouse.Target.Parent.Name == "Telephone" then
  461. order(mouse)
  462. end
  463.  
  464.  
  465. --[[if mouse.Target.Locked == false then
  466. if mouse.Target.Name == "MountainDew" and s.TeamColor == BrickColor.new(106) or
  467. mouse.Target.Name == "FullBox" and s.TeamColor == BrickColor.new(106) or
  468. mouse.Target.Name == "EmptyBox" and s.TeamColor == BrickColor.new(106) or
  469. mouse.Target.Name == "Pizza" and s.TeamColor == BrickColor.new(106) or
  470. mouse.Target.Name == "Dew" and s.TeamColor == BrickColor.new(24) or
  471. mouse.Target.Name == "Dough" and s.TeamColor == BrickColor.new(24) or
  472. mouse.Target:FindFirstChild("Refill") ~= nil and s.TeamColor == BrickColor.new(1) then
  473.  
  474. selected = mouse.Target
  475. selected.Parent = bin.Parent.Parent.Character
  476. mouse.Icon = "rbxasset://textures\\GrabCursor.png"
  477. --anc = selected.Anchored
  478. selected.Anchored = true
  479. if mouse.Target:FindFirstChild("Owner") ~= nil then
  480. mouse.Target.Owner.Value = s
  481. end
  482. end
  483. end]]
  484. end
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497. function onKeyDown(key)
  498. end
  499.  
  500. function onSelected(mouse)
  501. mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
  502. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  503. --mouse.Button1Up:connect(function() onButton1Up(mouse) end)
  504. mouse.Move:connect(function() onMove(mouse) end)
  505. --mouse.Idle:connect(function() onIdle(mouse) end)
  506. mouse.KeyDown:connect(onKeyDown)
  507. end
  508. bin.Selected:connect(onSelected)
  509.  
  510.  
  511. function de()
  512. option = false
  513. end
  514.  
  515. bin.Deselected:connect(de)
Advertisement
Add Comment
Please, Sign In to add comment