Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bin=script.Parent
- selected = nil
- s = script.Parent.Parent.Parent
- tar = nil
- mess = nil
- e = nil
- top = ""
- option = false
- options = 0
- targey = nil
- --give raise
- --take raise
- --make employee of the day
- --send home
- --send to spawn
- house = {"a1","a2","a3","b1","b2","b3","c1","c2","c3"}
- 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"}
- message = Instance.new("Message")
- message.Parent = s.Character
- force = Instance.new("SelectionBox")
- force.Parent = message
- script.force.Value = force
- --script.Parent.TextureId = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username=" .. string.lower(script.parent.parent.parent.Name)
- function icony(mouse)
- local size = mouse.ViewSizeY
- local threeOp = {size / 5, (size / 5 + size/5), (size / 5 + size/5)+ size /5,(size / 5 + size/5)+ (size/5+size/5),size}
- if mouse.Y <= threeOp[1] then
- options = 1
- elseif mouse.Y <= threeOp[2] then
- options = 2
- elseif mouse.Y <= threeOp[3] then
- options = 3
- elseif mouse.Y <= threeOp[4] then
- options = 4
- elseif mouse.Y <= threeOp[5] then
- options = 5
- end
- end
- function sitDown()
- if script.Parent.Person.Value == nil then return end
- local g = game.Workspace:GetChildren()
- for i = 1,#g do
- if g[i].Name == "CustomerDis" and g[i].Torso.Transparency == 1 then
- g[i].Torso.BrickColor = script.Parent.Person.Value.Torso.BrickColor
- g[i].Head.BrickColor = script.Parent.Person.Value.Head.BrickColor
- g[i]["Right Arm"].BrickColor = script.Parent.Person.Value["Right Arm"].BrickColor
- g[i]["Left Arm"].BrickColor = script.Parent.Person.Value["Left Arm"].BrickColor
- g[i]["Left Leg"].BrickColor = script.Parent.Person.Value["Left Leg"].BrickColor
- g[i]["Right Leg"].BrickColor = script.Parent.Person.Value["Right Leg"].BrickColor
- local s = script.Script:clone()
- s.Disabled = false
- s.Parent = g[i]
- return
- end
- end
- end
- function deliver(mouse)
- if mouse.Target.Name == "FullBox" then
- local y = game.Lighting.Storage.Pizza:clone()
- y.Name = "To: " .. string.upper(mouse.Target.House.Value)
- y.Parent = script.Parent.Parent.Parent.Backpack
- y.House.Value = mouse.Target.House.Value
- mouse.Target:remove()
- script.Parent.Step:Play()
- wait(0.2)
- script.Parent.Step:Stop()
- end
- if mouse.Target.Name == "MountainDew" then
- local yy = game.Lighting.Storage.MountainDew:clone()
- yy.Name = "To: " .. string.upper(mouse.Target.House.Value)
- yy.Parent = script.Parent.Parent.Parent.Backpack
- yy.House.Value = mouse.Target.House.Value
- mouse.Target:remove()
- script.Parent.Step:Play()
- wait(0.2)
- script.Parent.Step:Stop()
- end
- end
- function cook(mouse)
- if mouse.Target.Name == "Dough" and top ~= "" then
- st = game.Workspace.Items
- if top == "Sausage1" and mouse.Target.Topping.Value ~= 1 and mouse.Target.Topping.Value ~= 2 and st.Sausage.Value ~= 0 then
- mouse.Target.Owner.Value = script.Parent.Parent.Parent
- game.Lighting.Storage.Sausage:clone().Parent = mouse.Target
- mouse.Target.Topping.Value = 2
- st.Sausage.Value = st.Sausage.Value - 1
- script.Parent.Splat:Play()
- elseif top == "Pepperoni1" and mouse.Target.Topping.Value ~= 1 and mouse.Target.Topping.Value ~= 2 and st.Pepperoni.Value ~= 0 then
- game.Lighting.Storage.Pepperoni:clone().Parent = mouse.Target
- mouse.Target.Topping.Value = 1
- mouse.Target.Owner.Value = script.Parent.Parent.Parent
- st.Pepperoni.Value = st.Pepperoni.Value - 1
- script.Parent.Splat:Play()
- elseif top == "Cheese1" and mouse.Target.Cheese.Value ~= true and st.Cheese.Value ~= 0 then
- game.Lighting.Storage.Cheese:clone().Parent = mouse.Target
- mouse.Target.Cheese.Value = true
- mouse.Target.Owner.Value = script.Parent.Parent.Parent
- st.Cheese.Value = st.Cheese.Value - 1
- script.Parent.Splat:Play()
- elseif top == "TomatoSauce1" and mouse.Target.TomatoSauce.Value ~= true and st.TomatoSauce.Value ~= 0 then
- game.Lighting.Storage.TomatoSauce:clone().Parent = mouse.Target
- mouse.Target.TomatoSauce.Value = true
- mouse.Target.Owner.Value = script.Parent.Parent.Parent
- st.TomatoSauce.Value = st.TomatoSauce.Value - 1
- script.Parent.Splat:Play()
- end
- end
- if mouse.Target.Name == "Sausage1" or mouse.Target.Name == "Pepperoni1" or mouse.Target.Name == "Cheese1" or mouse.Target.Name == "TomatoSauce1" then
- top = mouse.Target.Name
- local targ = mouse.Target
- targ.BrickColor = BrickColor.new(21)
- wait()
- targ.BrickColor = BrickColor.new(1)
- end
- end
- function find()
- local g = game.Workspace.Customers:GetChildren()
- return g[math.random(1,#g)]
- end
- ab = nil
- function phone(mouseTarget)
- if mouseTarget.Parent.Name == "Phone" and mouseTarget.Parent.Ringing.Value == true and mouseTarget.Parent.Order.Value == false then
- e = find()
- mess = Instance.new("Hint")
- mess.Text = r[e.Value]
- mess.Parent = script.Parent.Parent.Parent.PlayerGui
- script.Parent.Person.Value = e
- mode = 2
- mouseTarget.Parent.Ringing.Value = false
- elseif mouseTarget.Parent.Name == "Phone" and mouseTarget.Parent.Ringing.Value == true and mouseTarget.Parent.Order.Value == true then
- human = true
- ab = mouseTarget.Parent.House.Value
- e = game.Workspace.Customers.Cheese
- mess = Instance.new("Hint")
- mess.Text = mouseTarget.Parent.Customer.Value .. " wants a cheese pizza"
- mess.Parent = script.Parent.Parent.Parent
- script.Parent.Person.Value = e
- mode = 2
- mouseTarget.Parent.Ringing.Value = false
- mouseTarget.Parent.Order.Value = false
- end
- if mouseTarget.Parent.Name == "Register" and mode == 2 and script.Parent.Person.Value ~= nil then
- if mouseTarget.Value.Value == e.Value then
- local gy = mouseTarget:FindFirstChild(mouseTarget.Name)
- if gy ~= nil then
- tar = mouseTarget
- tar.Parent.Screen.Ding:Play()
- local f = Instance.new("Decal")
- f.Texture = gy.Texture
- f.Name = gy.Name
- f.Face = "Front"
- f.Parent = game.Workspace.Orders.Storage
- s.Cashier.Value = script.Parent.Parent.Parent.Cashier.Value + 1
- local h = Instance.new("StringValue")
- if human == false then
- h.Value = house[math.random(1,#house)]
- elseif human == true then
- h.Value = ab
- end
- h.Name = "House"
- h.Parent = f
- mess.Parent = nil
- script.Parent.Person.Value = nil
- tar.BrickColor = BrickColor.new(21)
- wait()
- tar.BrickColor = BrickColor.new(194)
- end
- end
- end
- end
- function register(mouseTarget)
- local r = mouseTarget.Parent:FindFirstChild("Say")
- if r ~= nil then
- r.Parent.Name = r.Value
- script.Parent.Person.Value = mouseTarget.Parent
- mode = 1
- end
- if mouseTarget.Parent.Name == "Register" and mode == 1 then
- if script.Parent.Person.Value ~= nil then
- if mouseTarget.Value.Value == script.Parent.Person.Value.Order.Value then
- local g = mouseTarget:FindFirstChild(mouseTarget.Name)
- if g ~= nil then
- tar = mouseTarget
- tar.Parent.Screen.Ding:Play()
- local f = Instance.new("Decal")
- f.Texture = g.Texture
- f.Name = g.Name
- f.Face = "Front"
- f.Parent = game.Workspace.Orders.Storage
- mode = 1
- s.Cashier.Value = s.Cashier.Value + 1
- local h = Instance.new("StringValue")
- h.Value = script.Parent.Person.Value.House.Value
- h.Name = "House"
- h.Parent = f
- local y = script.Parent.Person.Value.Lane.Value
- if y == 1 then
- game.Workspace.Lane1.OCC.Value = false
- elseif y == 2 then
- game.Workspace.Lane2.OCC.Value = false
- end
- if script.Parent.Person.Value:FindFirstChild("Seat") == nil then
- sitDown()
- end
- script.Parent.Person.Value.Parent = nil
- script.Parent.Person.Value = nil
- tar.BrickColor = BrickColor.new(21)
- wait()
- tar.BrickColor = BrickColor.new(194)
- end
- end
- end
- end
- end
- tot = nil
- function order(mouse)
- 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
- if game.Workspace.Phone.Order.Value == false then
- game.Workspace.Phone.Order.Value = true
- game.Workspace.Phone.Ringing.Value = true
- workspace.Phone.House.Value = mouse.Target.Parent.Parent.Parent.House.Value
- workspace.Phone.Customer.Value = s.Name
- local t = Instance.new("ObjectValue")
- t.Name = "Order"
- t.Parent = mouse.Target.Parent.Parent.Parent
- local ty = script.Scripty:clone()
- ty.Disabled = false
- ty.Parent = t
- end
- end
- end
- function onMove(mouse)
- if mouse.Target == nil then return end
- if mouse.Target ~= tot then
- force.Parent = nil
- force.Adornee = nil
- end
- if option == true then
- icony(mouse)
- return
- end
- --[[if selected ~= nil then
- pos = mouse.Hit.p
- x = pos.x
- y = pos.y
- z = pos.z
- if mouse.Target ~= selected then
- selected.CFrame = mouse.Target.CFrame
- end
- 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))
- end]]
- if selected ~= nil then return end
- if mouse.Target.Locked == false and selected == nil or
- mouse.Target.Size == Vector3.new(4,1.2,4) and s.TeamColor == BrickColor.new(24) or
- mouse.Target.Parent.Name == "Register" and s.TeamColor == BrickColor.new(21) or
- mouse.Target:FindFirstChild("Refill") ~= nil and s.TeamColor == BrickColor.new(1) then
- force.Parent = mouse.Target
- force.Adornee = mouse.Target
- tot = mouse.Target
- mouse.Icon = "rbxasset://textures\\DragCursor.png"
- return
- end
- if mouse.Target.Parent.Name == "Phone" and s.TeamColor == BrickColor.new(21) or
- mouse.Target.Parent:FindFirstChild("Lane") ~= nil and s.TeamColor == BrickColor.new(21) or
- mouse.Target.Parent:FindFirstChild("Humanoid") ~= nil and game.Players:GetPlayerFromCharacter(mouse.Target.Parent) ~= nil and s.TeamColor == BrickColor.new(28) or
- mouse.Target.Parent.Name == "Telephone" and mouse.Target.Parent.Parent.Parent.Owner.Value == script.Parent.Parent.Parent then
- force.Parent = mouse.Target.Parent
- force.Adornee = mouse.Target.Parent
- tot = mouse.Target
- mouse.Icon = "rbxasset://textures\\DragCursor.png"
- return
- else
- mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
- end
- end
- --if s.TeamColor == BrickColor.new(23) then
- --[[function onButton1Up(mouse)
- if selected ~= nil then
- selected.Parent = game.Workspace
- selected.Anchored = false
- wait()
- selected.Velocity = Vector3.new(1,0,0)
- 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))
- if selected:FindFirstChild("Refill") ~= nil then
- selected:MakeJoints()
- end
- selected = nil
- mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
- end
- end]]
- raiseDe = false
- homeDe = false
- spawnDe = false
- function onButton1Down(mouse)
- if mouse.Target == nil then return end
- 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
- option = true
- targey = game.Players:GetPlayerFromCharacter(mouse.Target.Parent)
- return
- end
- if option == true and targey ~= nil then
- option = false
- if options == 1 and raiseDe == false then
- targey.leaderstats.Money.Value = targey.leaderstats.Money.Value + 30
- targey.Raise.Value = targey.Raise.Value + 1
- script.Parent.Parent.Parent.leaderstats.Money.Value = script.Parent.Parent.Parent.leaderstats.Money.Value - 5
- raiseDe = true
- wait(10)
- raiseDe = false
- return
- elseif options == 2 and targey.Raise.Value ~= 0 then
- targey.leaderstats.Money.Value = targey.leaderstats.Money.Value - 30
- targey.Raise.Value = targey.Raise.Value - 1
- s.leaderstats.Money.Value = s.leaderstats.Money.Value + 5
- return
- elseif options == 3 then
- game.Workspace.EOD.Value = targey
- return
- elseif options == 4 and homeDe == false then
- local g = game.Workspace:GetChildren()
- for i = 1,#g do
- if g[i].Name == "House" and g[i].Owner.Value == targey then
- targey.Character:MoveTo(g[i].Spawn.Position)
- end
- end
- homeDe = true
- wait(60)
- homeDe = false
- return
- elseif options == 5 and spawnDe == false then
- local g = game.Workspace:GetChildren()
- for i = 1,#g do
- if g[i].className == "SpawnLocation" then
- if g[i].BrickColor == targey.TeamColor then
- targey.Character:MoveTo(g[i].Position)
- end
- end
- end
- spawnDe = true
- wait(30)
- spawnDe = false
- return
- end
- end
- ------------------------------------------------------------------------------
- if s.TeamColor == BrickColor.new(21) then
- register(mouse.Target)
- phone(mouse.Target)
- end
- if s.TeamColor == BrickColor.new(24) then
- cook(mouse)
- end
- if mouse.Target.Name == "MountainDew" or mouse.Target.Name == "FullBox" then
- if s.TeamColor == BrickColor.new(23) then
- deliver(mouse)
- end
- end
- if mouse.Target.Parent.Name == "Telephone" then
- order(mouse)
- end
- --[[if mouse.Target.Locked == false then
- if mouse.Target.Name == "MountainDew" and s.TeamColor == BrickColor.new(106) or
- mouse.Target.Name == "FullBox" and s.TeamColor == BrickColor.new(106) or
- mouse.Target.Name == "EmptyBox" and s.TeamColor == BrickColor.new(106) or
- mouse.Target.Name == "Pizza" and s.TeamColor == BrickColor.new(106) or
- mouse.Target.Name == "Dew" and s.TeamColor == BrickColor.new(24) or
- mouse.Target.Name == "Dough" and s.TeamColor == BrickColor.new(24) or
- mouse.Target:FindFirstChild("Refill") ~= nil and s.TeamColor == BrickColor.new(1) then
- selected = mouse.Target
- selected.Parent = bin.Parent.Parent.Character
- mouse.Icon = "rbxasset://textures\\GrabCursor.png"
- --anc = selected.Anchored
- selected.Anchored = true
- if mouse.Target:FindFirstChild("Owner") ~= nil then
- mouse.Target.Owner.Value = s
- end
- end
- end]]
- end
- function onKeyDown(key)
- end
- function onSelected(mouse)
- mouse.Icon = "rbxasset://textures\\ArrowFarCursor.png"
- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
- --mouse.Button1Up:connect(function() onButton1Up(mouse) end)
- mouse.Move:connect(function() onMove(mouse) end)
- --mouse.Idle:connect(function() onIdle(mouse) end)
- mouse.KeyDown:connect(onKeyDown)
- end
- bin.Selected:connect(onSelected)
- function de()
- option = false
- end
- bin.Deselected:connect(de)
Advertisement
Add Comment
Please, Sign In to add comment