I looked other the entire code again now,
Still unable to locate the error.
Here’s a video of what happens:
And Here’s the Code inside the NPC Character.
I know it’s not organized well.
local NeedFolder = script.Parent.Needs
local Hum = script.Parent:WaitForChild("Humanoid")
local Head = script.Parent:WaitForChild("Head")
local ChatService = game:GetService("Chat")
local HumPart = script.Parent:WaitForChild("HumanoidRootPart")
local Needs = {
Coffee = NeedFolder.Coffee.Value;
Milk = NeedFolder.Milk.Value;
Sugar = NeedFolder.Sugar.Value;
Cookies = NeedFolder.Cookies.Value;
Donuts = NeedFolder.Donuts.Value;
Completed = NeedFolder.OrderCompleted.Value;
Food = NeedFolder.Food.Value;
}
local Spawns = {
StartSpawn = game.Workspace.GameStoring.Spawns.NPCEnd.CFrame;
SpawnsCoffee = game.Workspace.GameStoring.Spawns.SpawnsCoffeee;
SpawnsFood = game.Workspace.GameStoring.Spawns.SpawnsFood;
}
--Anims
local Load = humanoid:LoadAnimation(script.Parent.Animations.Sit)
local LoadTalk = humanoid:LoadAnimation(script.Parent.Animations.SitTalk)
local LoadDrink = humanoid:LoadAnimation(script.Parent.Animations.SitDrink)
local LoadEat = humanoid:LoadAnimation(script.Parent.Animations.SitEat)
function RandomCoffeeNeeds()
--GoTo Coffee Bar
for index, descendant in Spawns.SpawnsCoffee:GetChildren() do
local Done = false
if descendant.Available.Value == true then
descendant.Available.Value = false
script.Parent.Needs.Seat.Value = descendant.Name
local MilkMath = math.random(1,3)
walkTo(descendant)
HumPart.CFrame = descendant.Spawner.CFrame
HumPart.Anchored = true
Load:Play()
if MilkMath == 1 then
Needs.Coffee = true
Needs.Milk = true
Needs.Sugar = false
Needs.Completed = false
Needs.Food = false
Needs.Donuts = false
Needs.Cookies = false
ChatService:Chat(Head, "Can I have a Coffee With Milk?")
elseif MilkMath == 2 then
Needs.Coffee = true
Needs.Milk = false
Needs.Sugar = false
Needs.Completed = false
Needs.Food = false
Needs.Donuts = false
Needs.Cookies = false
ChatService:Chat(Head, "Can I Just get a Coffee?")
elseif MilkMath == 3 then
Needs.Coffee = true
Needs.Milk = false
Needs.Sugar = true
Needs.Completed = false
Needs.Food = false
Needs.Donuts = false
Needs.Cookies = false
ChatService:Chat(Head, "Can I have a Coffee With Sugar?")
end
print("Customer found Spot!")
Done = true
else
end
if Done == true then
break
end
end
end
function RandomFoodNeeds()
--Randomize which food!
for index, descendant in Spawns.SpawnsFood:GetChildren() do
local Done = false
if descendant.Available.Value == true then
descendant.Available.Value = false
script.Parent.Needs.Seat.Value = descendant.Name
walkTo(descendant)
HumPart.CFrame = descendant.Spawner.CFrame
HumPart.Anchored = true
Load:Play()
local FoodMath = math.random(1,2)
if FoodMath == 1 then
Needs.Coffee = true
Needs.Milk = false
Needs.Sugar = false
Needs.Completed = false
Needs.Food = true
Needs.Donuts = true
Needs.Cookies = false
ChatService:Chat(Head, "Can I have a Donut?")
elseif FoodMath == 2 then
Needs.Coffee = true
Needs.Milk = false
Needs.Sugar = false
Needs.Completed = false
Needs.Food = true
Needs.Donuts = false
Needs.Cookies = true
ChatService:Chat(Head, "Can I Just get a Cookie?")
end
print("Customer found Spot!")
Done = true
else
end
if Done == true then
break
end
end
end
function RandomNeeds()
if game.Workspace:WaitForChild("GameStoring").SaveData.FoodServing.Value == true then --Randomize between coffee and Food
local CoffeeFood = math.random(1,2)
if CoffeeFood == 1 then
RandomCoffeeNeeds()
else
RandomFoodNeeds()
end
elseif game.Workspace:WaitForChild("GameStoring").SaveData.FoodServing.Value == false then
RandomCoffeeNeeds()
end
end
function RandomMood()
local MoodMath = math.random(1,3)
if MoodMath == 1 then
script.Parent.Head["Mouth james"].Texture = "rbxassetid://2801767831"
elseif MoodMath == 2 then
script.Parent.Head["Mouth james"].Texture = "rbxassetid://2818152144"
elseif MoodMath == 3 then
script.Parent.Head["Mouth james"].Texture = "rbxassetid://2801767539"
end
end
function InitiateStartUp()
Needs.Completed = false
Needs.Coffee = false
Needs.Milk = false
Needs.Sugar = false
Needs.Cookies = false
Needs.Donuts = false
Needs.Food = false
RandomMood()
HumPart.CFrame = Spawns.StartSpawn
wait(1)
RandomNeeds()
end
function SpawnNewNPC()
Needs.Completed = false
Needs.Coffee = false
Needs.Milk = false
Needs.Sugar = false
Needs.Cookies = false
Needs.Donuts = false
Needs.Food = false
script.Parent.HumanoidRootPart.Anchored = false
local ClonedNPC = script.Parent:Clone()
ClonedNPC.NPCMane.Enabled = false
ClonedNPC.Parent = game.Workspace.NPCFolder
local HairRandomizer = math.random(1,7)
local PantsRandomizer = math.random(1,12)
local HoodRandomizer = math.random(1,12)
local BrilleRandomizer = math.random(1,2)
--Pants
if PantsRandomizer == 1 then
ClonedNPC.Pants.PantsTemplate = "rbxassetid://129458425"
elseif PantsRandomizer == 2 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=129459076"
elseif PantsRandomizer == 3 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=5313245741"
elseif PantsRandomizer == 4 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=14091903575"
elseif PantsRandomizer == 5 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=12598478935"
elseif PantsRandomizer == 6 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=11936234746"
elseif PantsRandomizer == 7 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=12380638123"
elseif PantsRandomizer == 8 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=10011797164"
elseif PantsRandomizer == 9 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=9962794250"
elseif PantsRandomizer == 10 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=144076759"
elseif PantsRandomizer == 11 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=10349860095"
elseif PantsRandomizer == 12 then
ClonedNPC.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=15491580391"
end
--Hood
if HoodRandomizer == 1 then
ClonedNPC.Shirt.ShirtTemplate = "rbxassetid://13219934413"
elseif HoodRandomizer == 2 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=8961290589"
elseif HoodRandomizer == 3 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=12156332326"
elseif HoodRandomizer == 4 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=8108996208"
elseif HoodRandomizer == 5 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=7136156278"
elseif HoodRandomizer == 6 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=10634595316"
elseif HoodRandomizer == 7 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=5829330449"
elseif HoodRandomizer == 8 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=6835796049"
elseif HoodRandomizer == 9 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=12025874058"
elseif HoodRandomizer == 10 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=4707715241"
elseif HoodRandomizer == 11 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=10067425447"
elseif HoodRandomizer == 12 then
ClonedNPC.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=5134719718"
end
--Brille
if BrilleRandomizer == 1 then
ClonedNPC.Options.Glasses.Transparency = 1
else
ClonedNPC.Options.Glasses.Transparency = 0
end
ClonedNPC.MeshPartAccessory.Handle.Transparency = 1
ClonedNPC["Meshes/blackiAccessory"].Handle.Transparency = 1
ClonedNPC.Handle.Transparency = 1
ClonedNPC.DazzlingMessBrown.Handle.Transparency = 1
ClonedNPC["Hair1.1"].Handle.Transparency = 1
ClonedNPC["Accessory (Straight Hair with Headphones)"].Handle.Transparency = 1
ClonedNPC["Accessory (Anime Wolf Cut Hair)"].Handle.Transparency = 1
if HairRandomizer == 1 then
ClonedNPC.MeshPartAccessory.Handle.Transparency = 0
ClonedNPC["Meshes/blackiAccessory"].Handle.Transparency = 1
ClonedNPC.Handle.Transparency = 1
ClonedNPC.DazzlingMessBrown.Handle.Transparency = 1
ClonedNPC["Hair1.1"].Handle.Transparency = 1
ClonedNPC["Accessory (Straight Hair with Headphones)"].Handle.Transparency = 1
ClonedNPC["Accessory (Anime Wolf Cut Hair)"].Handle.Transparency = 1
elseif HairRandomizer == 2 then
ClonedNPC.MeshPartAccessory.Handle.Transparency = 1
ClonedNPC["Meshes/blackiAccessory"].Handle.Transparency = 0
ClonedNPC.Handle.Transparency = 1
ClonedNPC.DazzlingMessBrown.Handle.Transparency = 1
ClonedNPC["Hair1.1"].Handle.Transparency = 1
ClonedNPC["Accessory (Straight Hair with Headphones)"].Handle.Transparency = 1
ClonedNPC["Accessory (Anime Wolf Cut Hair)"].Handle.Transparency = 1
elseif HairRandomizer == 3 then
ClonedNPC.Handle.Transparency = 1
ClonedNPC.DazzlingMessBrown.Handle.Transparency = 1
ClonedNPC["Hair1.1"].Handle.Transparency = 0
ClonedNPC["Accessory (Straight Hair with Headphones)"].Handle.Transparency = 1
ClonedNPC["Accessory (Anime Wolf Cut Hair)"].Handle.Transparency = 1
elseif HairRandomizer == 4 then
ClonedNPC.MeshPartAccessory.Handle.Transparency = 1
ClonedNPC["Meshes/blackiAccessory"].Handle.Transparency = 1
ClonedNPC.Handle.Transparency = 1
ClonedNPC.DazzlingMessBrown.Handle.Transparency = 0
ClonedNPC["Hair1.1"].Handle.Transparency = 1
ClonedNPC["Accessory (Straight Hair with Headphones)"].Handle.Transparency = 1
ClonedNPC["Accessory (Anime Wolf Cut Hair)"].Handle.Transparency = 1
elseif HairRandomizer == 5 then
ClonedNPC.MeshPartAccessory.Handle.Transparency = 1
ClonedNPC["Meshes/blackiAccessory"].Handle.Transparency = 1
ClonedNPC.Handle.Transparency = 1
ClonedNPC.DazzlingMessBrown.Handle.Transparency = 1
ClonedNPC["Hair1.1"].Handle.Transparency = 0
ClonedNPC["Accessory (Straight Hair with Headphones)"].Handle.Transparency = 1
ClonedNPC["Accessory (Anime Wolf Cut Hair)"].Handle.Transparency = 1
elseif HairRandomizer == 6 then
ClonedNPC.MeshPartAccessory.Handle.Transparency = 1
ClonedNPC["Meshes/blackiAccessory"].Handle.Transparency = 1
ClonedNPC.Handle.Transparency = 1
ClonedNPC.DazzlingMessBrown.Handle.Transparency = 1
ClonedNPC["Hair1.1"].Handle.Transparency = 1
ClonedNPC["Accessory (Straight Hair with Headphones)"].Handle.Transparency = 0
ClonedNPC["Accessory (Anime Wolf Cut Hair)"].Handle.Transparency = 1
elseif HairRandomizer == 7 then
ClonedNPC.MeshPartAccessory.Handle.Transparency = 1
ClonedNPC["Meshes/blackiAccessory"].Handle.Transparency = 1
ClonedNPC.Handle.Transparency = 1
ClonedNPC.DazzlingMessBrown.Handle.Transparency = 1
ClonedNPC["Hair1.1"].Handle.Transparency = 1
ClonedNPC["Accessory (Straight Hair with Headphones)"].Handle.Transparency = 1
ClonedNPC["Accessory (Anime Wolf Cut Hair)"].Handle.Transparency = 0
end
wait(1)
ClonedNPC.NPCMane.Enabled = true
wait(0.5)
script.Parent:Destroy()
game.ReplicatedStorage.Events.NewNPC:FireAllClients(ClonedNPC)
end
local BadgeService = game:GetService("BadgeService")
function Drink(User)
script.Parent.Tasse.Transparency = 0
script.GebenKaffee:Play()
Needs.Completed = true
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
LoadDrink:Play()
Load:Stop()
wait(1)
script.MONETEN:Play()
game.Workspace.GameStoring.SaveData.Cash.Value += 10
script.Parent.Handle.ParticleEmitter.Enabled = true
wait(0.5)
script.Parent.Handle.ParticleEmitter.Enabled = false
wait(3)
local RandomTip = math.random(1,5)
if RandomTip == 1 then
local Tip = math.random(1,5)
game.Workspace.GameStoring.SaveData.Cash.Value += Tip
ChatService:Chat(Head, "Here, Have a tip.")
script.MONETEN:Play()
script.Parent.Handle.ParticleEmitter.Enabled = true
wait(0.5)
script.Parent.Handle.ParticleEmitter.Enabled = false
elseif RandomTip >= 2 then
print("No Tip Given by customer.")
end
--Normal Money
ChatService:Chat(Head, "Thanks, " .. User.Name)
wait(5)
local RandomMessage = math.random(1,5)
if RandomMessage == 1 then
ChatService:Chat(Head, "This is good")
elseif RandomMessage == 2 then
ChatService:Chat(Head, "Tastes like Coffee.")
elseif RandomMessage == 3 then
ChatService:Chat(Head, "Tastes like Coffee with More Coffee.")
elseif RandomMessage == 4 then
ChatService:Chat(Head, "I love this Bar!")
end
wait(2)
local RandomMessage = math.random(1,5)
if RandomMessage == 1 then
ChatService:Chat(Head, "Yea, Thanks.")
elseif RandomMessage == 3 then
ChatService:Chat(Head, "Thanks for your Service.")
elseif RandomMessage == 4 then
ChatService:Chat(Head, "This is one of the best Bars Ever.")
elseif RandomMessage == 5 then
ChatService:Chat(Head, "Thanks, I'll come here more often now.")
end
wait(10)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
local LeaveMessage = math.random(1,5)
if LeaveMessage == 1 then
ChatService:Chat(Head, "Yea, I'll see ya.")
elseif LeaveMessage == 2 then
ChatService:Chat(Head, "Bye, Bye!")
elseif LeaveMessage == 3 then
ChatService:Chat(Head, "Oh, I need to go already.")
elseif LeaveMessage == 5 then
ChatService:Chat(Head, "Uh I think I have a meeting in a few minutes, Bye!")
end
script.Parent.Tasse.Transparency = 1
LoadDrink:Stop()
Load:Play()
wait(2)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
if Needs.Coffee == true then
game.Workspace.GameStoring.Spawns.SpawnsCoffeee:WaitForChild(script.Parent.Needs.Seat.Value).Available.Value = true
end
script.Parent.HumanoidRootPart.Anchored = false
Load:Stop()
walkTo(game.Workspace.GameStoring.Spawns.NPCEnd)
script.Parent.LowerTorso.CFrame = game.Workspace.GameStoring.Spawns.NPCStartSpawn.CFrame
wait(1)
local Waiter = math.random(1,8)
wait(Waiter)
SpawnNewNPC()
end
function Eat(User)
if Needs.Donuts == true then
script.Parent.Donut.Torus_Torus.Transparency = 0
script.Parent.Donut["Torus.001_Torus.001"].Transparency = 0
elseif Needs.Cookies == true then
script.Parent.Keks["Cylinder.002_Cylinder.002"].Transparency = 0
script.Parent.Keks.Cylinder_Cylinder.Transparency = 0
end
script.GebenKaffee:Play()
Needs.Completed = true
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
LoadEat:Play()
Load:Stop()
wait(1)
script.MONETEN:Play()
game.Workspace.GameStoring.SaveData.Cash.Value += 20
script.Parent.Handle.ParticleEmitter.Enabled = true
wait(0.5)
script.Parent.Handle.ParticleEmitter.Enabled = false
wait(3)
local RandomTip = math.random(1,10)
if RandomTip == 1 then
local Tip = math.random(1,10)
game.Workspace.GameStoring.SaveData.Cash.Value += Tip
ChatService:Chat(Head, "Here, Have a tip.")
script.MONETEN:Play()
script.Parent.Handle.ParticleEmitter.Enabled = true
wait(0.5)
script.Parent.Handle.ParticleEmitter.Enabled = false
elseif RandomTip >= 2 then
print("No Tip Given by customer.")
end
--Normal Money
ChatService:Chat(Head, "Thanks, " .. User.Name)
wait(5)
local RandomMessage = math.random(1,5)
if RandomMessage == 1 then
ChatService:Chat(Head, "This is Food.")
elseif RandomMessage == 2 then
ChatService:Chat(Head, "Tastes like Food.")
elseif RandomMessage == 3 then
ChatService:Chat(Head, "Tastes like Food with more Calories.")
elseif RandomMessage == 4 then
ChatService:Chat(Head, "I love this Food!")
end
wait(2)
local RandomMessage = math.random(1,5)
if RandomMessage == 1 then
ChatService:Chat(Head, "Yea, Thanks.")
elseif RandomMessage == 3 then
ChatService:Chat(Head, "Thanks for your Service.")
elseif RandomMessage == 4 then
ChatService:Chat(Head, "This is one of the best Foods Ever.")
elseif RandomMessage == 5 then
ChatService:Chat(Head, "Thanks, I'll come here more often now.")
end
wait(10)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
local LeaveMessage = math.random(1,5)
if LeaveMessage == 1 then
ChatService:Chat(Head, "Yea, I'll see ya.")
elseif LeaveMessage == 2 then
ChatService:Chat(Head, "Bye, Bye!")
elseif LeaveMessage == 3 then
ChatService:Chat(Head, "Oh, I need to go already.")
elseif LeaveMessage == 5 then
ChatService:Chat(Head, "Uh I think I have a Food-meeting in a few minutes, Bye!")
end
script.Parent.Donut.Torus_Torus.Transparency = 1
script.Parent.Donut["Torus.001_Torus.001"].Transparency = 1
script.Parent.Keks["Cylinder.002_Cylinder.002"].Transparency = 1
script.Parent.Keks.Cylinder_Cylinder.Transparency = 1
LoadEat:Stop()
Load:Play()
wait(2)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
if Needs.Food == true then
game.Workspace.GameStoring.Spawns.SpawnsFood:WaitForChild(script.Parent.Needs.Seat.Value).Available.Value = true
end
script.Parent.HumanoidRootPart.Anchored = false
Load:Stop()
walkTo(game.Workspace.GameStoring.Spawns.NPCEnd)
script.Parent.LowerTorso.CFrame = game.Workspace.GameStoring.Spawns.NPCStartSpawn.CFrame
wait(1)
local Waiter = math.random(1,8)
wait(Waiter)
SpawnNewNPC()
end
script.Parent:WaitForChild("UpperTorso").ClickDetector.MouseClick:Connect(function(player) --Check If Right
--Check which one if not taken
local User = player
if Needs.Completed == true then
ChatService:Chat(Head, "Why u askin' me now?")
else
if player.Character:FindFirstChild("Items").HasItem.Value == true then
if Needs.Milk == true and Needs.Coffee == true then
if player.Character:WaitForChild("Items").Coffee.Value == true and player.Character:WaitForChild("Items").Milk.Value == true and player.Character:WaitForChild("Items").Sugar.Value == false then
player.Character:WaitForChild("Items").Coffee.Value = false
player.Character:WaitForChild("Items").HasItem.Value = false
player.Character:WaitForChild("Items").Sugar.Value = false
player.Character:WaitForChild("Items").Milk.Value = false
player.Character:WaitForChild("Items").Donuts.Value = false
player.Character:WaitForChild("Items").Cookies.Value = false
player.Character:WaitForChild("Tasse").Transparency = 1
Drink(User)
else
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
local RandomTextBubble = math.random(1,3)
if RandomTextBubble == 1 then
ChatService:Chat(Head, "That's not.. What I've ordered.")
wait(1)
ChatService:Chat(Head, "I've ordered..")
wait(1)
elseif RandomTextBubble == 2 then
ChatService:Chat(Head, "I didn't order that!")
wait(1)
ChatService:Chat(Head, "Now.. Please. I've ordered")
wait(1)
elseif RandomTextBubble == 3 then
ChatService:Chat(Head, "Okay... So I ordered...")
wait(1)
end
if Needs.Milk == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Milk.")
elseif Needs.Milk == false and Needs.Sugar == false and Needs.Coffee == true then
ChatService:Chat(Head, "Just a Coffee.")
elseif Needs.Sugar == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Sugar.")
--Food
elseif Needs.Donuts == true then
ChatService:Chat(Head, "a Donut.")
elseif Needs.Cookies == true then
ChatService:Chat(Head, "a Cookie.")
end
wait(2)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 16
end
elseif Needs.Milk == false and Needs.Sugar == false and Needs.Coffee == true then
if player.Character:WaitForChild("Items").Coffee.Value == true and player.Character:WaitForChild("Items").Milk.Value == false and player.Character:WaitForChild("Items").Sugar.Value == false then
player.Character:WaitForChild("Items").Coffee.Value = false
player.Character:WaitForChild("Items").HasItem.Value = false
player.Character:WaitForChild("Items").Sugar.Value = false
player.Character:WaitForChild("Items").Milk.Value = false
player.Character:WaitForChild("Items").Donuts.Value = false
player.Character:WaitForChild("Items").Cookies.Value = false
player.Character:WaitForChild("Tasse").Transparency = 1
Drink(User)
else
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
local RandomTextBubble = math.random(1,3)
if RandomTextBubble == 1 then
ChatService:Chat(Head, "That's not.. What I've ordered.")
wait(1)
ChatService:Chat(Head, "I've ordered..")
wait(1)
elseif RandomTextBubble == 2 then
ChatService:Chat(Head, "I didn't order that!")
wait(1)
ChatService:Chat(Head, "Now.. Please. I've ordered")
wait(1)
elseif RandomTextBubble == 3 then
ChatService:Chat(Head, "Okay... So I ordered...")
wait(1)
end
if Needs.Milk == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Milk.")
elseif Needs.Milk == false and Needs.Sugar == false and Needs.Coffee == true then
ChatService:Chat(Head, "Just a Coffee.")
elseif Needs.Sugar == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Sugar.")
--Food
elseif Needs.Donuts == true then
ChatService:Chat(Head, "a Donut.")
elseif Needs.Cookies == true then
ChatService:Chat(Head, "a Cookie.")
end
wait(2)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 16
end
elseif Needs.Sugar == true and Needs.Coffee == true then
if player.Character:WaitForChild("Items").Coffee.Value == true and player.Character:WaitForChild("Items").Milk.Value == false and player.Character:WaitForChild("Items").Sugar.Value == true then
player.Character:WaitForChild("Items").Coffee.Value = false
player.Character:WaitForChild("Items").HasItem.Value = false
player.Character:WaitForChild("Items").Sugar.Value = false
player.Character:WaitForChild("Items").Milk.Value = false
player.Character:WaitForChild("Items").Donuts.Value = false
player.Character:WaitForChild("Items").Cookies.Value = false
player.Character:WaitForChild("Tasse").Transparency = 1
Drink(User)
else
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
local RandomTextBubble = math.random(1,3)
if RandomTextBubble == 1 then
ChatService:Chat(Head, "That's not.. What I've ordered.")
wait(1)
ChatService:Chat(Head, "I've ordered..")
wait(1)
elseif RandomTextBubble == 2 then
ChatService:Chat(Head, "I didn't order that!")
wait(1)
ChatService:Chat(Head, "Now.. Please. I've ordered")
wait(1)
elseif RandomTextBubble == 3 then
ChatService:Chat(Head, "Okay... So I ordered...")
wait(1)
end
if Needs.Milk == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Milk.")
elseif Needs.Milk == false and Needs.Sugar == false and Needs.Coffee == true then
ChatService:Chat(Head, "Just a Coffee.")
elseif Needs.Sugar == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Sugar.")
--Food
elseif Needs.Donuts == true then
ChatService:Chat(Head, "a Donut.")
elseif Needs.Cookies == true then
ChatService:Chat(Head, "a Cookie.")
end
wait(2)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 16
end
elseif Needs.Donuts == true then
if player.Character:WaitForChild("Items").Donuts.Value == true then
player.Character:WaitForChild("Items").Coffee.Value = false
player.Character:WaitForChild("Items").HasItem.Value = false
player.Character:WaitForChild("Items").Sugar.Value = false
player.Character:WaitForChild("Items").Milk.Value = false
player.Character:WaitForChild("Items").Donuts.Value = false
player.Character:WaitForChild("Items").Cookies.Value = false
player.Character:WaitForChild("Tasse").Transparency = 1
Eat(User)
else
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
local RandomTextBubble = math.random(1,3)
if RandomTextBubble == 1 then
ChatService:Chat(Head, "That's not.. What I've ordered.")
wait(1)
ChatService:Chat(Head, "I've ordered..")
wait(1)
elseif RandomTextBubble == 2 then
ChatService:Chat(Head, "I didn't order that!")
wait(1)
ChatService:Chat(Head, "Now.. Please. I've ordered")
wait(1)
elseif RandomTextBubble == 3 then
ChatService:Chat(Head, "Okay... So I ordered...")
wait(1)
end
if Needs.Milk == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Milk.")
elseif Needs.Milk == false and Needs.Sugar == false and Needs.Coffee == true then
ChatService:Chat(Head, "Just a Coffee.")
elseif Needs.Sugar == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Sugar.")
--Food
elseif Needs.Donuts == true then
ChatService:Chat(Head, "a Donut.")
elseif Needs.Cookies == true then
ChatService:Chat(Head, "a Cookie.")
end
wait(2)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 16
end
elseif Needs.Cookies == true then
if player.Character:WaitForChild("Items").Cookies.Value == true then
player.Character:WaitForChild("Items").Coffee.Value = false
player.Character:WaitForChild("Items").HasItem.Value = false
player.Character:WaitForChild("Items").Sugar.Value = false
player.Character:WaitForChild("Items").Milk.Value = false
player.Character:WaitForChild("Items").Donuts.Value = false
player.Character:WaitForChild("Items").Cookies.Value = false
player.Character:WaitForChild("Tasse").Transparency = 1
Eat(User)
else
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 0
local RandomTextBubble = math.random(1,3)
if RandomTextBubble == 1 then
ChatService:Chat(Head, "That's not.. What I've ordered.")
wait(1)
ChatService:Chat(Head, "I've ordered..")
wait(1)
elseif RandomTextBubble == 2 then
ChatService:Chat(Head, "I didn't order that!")
wait(1)
ChatService:Chat(Head, "Now.. Please. I've ordered")
wait(1)
elseif RandomTextBubble == 3 then
ChatService:Chat(Head, "Okay... So I ordered...")
wait(1)
end
if Needs.Milk == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Milk.")
elseif Needs.Milk == false and Needs.Sugar == false and Needs.Coffee == true then
ChatService:Chat(Head, "Just a Coffee.")
elseif Needs.Sugar == true and Needs.Coffee == true then
ChatService:Chat(Head, "a Coffee With Sugar.")
--Food
elseif Needs.Donuts == true then
ChatService:Chat(Head, "a Donut.")
elseif Needs.Cookies == true then
ChatService:Chat(Head, "a Cookie.")
end
wait(2)
script.Parent.Hitbox.ClickDetector.MaxActivationDistance = 16
end
end
else
LoadTalk:Play()
Load:Stop()
local RandomTextBubble = math.random(1,3)
if RandomTextBubble == 1 then
ChatService:Chat(Head, "That's not.. What I've ordered.")
wait(1)
ChatService:Chat(Head, "I've ordered..")
wait(1)
elseif RandomTextBubble == 2 then
ChatService:Chat(Head, "I didn't order that!")
wait(1)
ChatService:Chat(Head, "Now.. Please. I've ordered")
wait(1)
elseif RandomTextBubble == 3 then
ChatService:Chat(Head, "Okay... So I ordered...")
wait(1)
end
script.Parent.UpperTorso.ClickDetector.MaxActivationDistance = 0
--
if NeedFolder.Milk.Value == true and NeedFolder.Coffee.Value == true and NeedFolder.Sugar.Value == false then
ChatService:Chat(Head, "a Coffee With Milk.")
elseif NeedFolder.Milk.Value == false and NeedFolder.Sugar.Value == false and NeedFolder.Coffee.Value == true then
ChatService:Chat(Head, "Just a Coffee.")
elseif NeedFolder.Sugar.Value == true and NeedFolder.Coffee.Value == true and NeedFolder.Milk.Value == false then
ChatService:Chat(Head, "a Coffee With Sugar.")
--Food
elseif NeedFolder.Donuts.Value == true then
ChatService:Chat(Head, "a Donut.")
elseif NeedFolder.Cookies.Value== true then
ChatService:Chat(Head, "a Cookie.")
else
ChatService:Chat(Head, "I've ordered.. Nothing.")
end
--
task.wait(4.5)
LoadTalk:Stop()
Load:Play()
script.Parent.UpperTorso.ClickDetector.MaxActivationDistance = 16
end
end
end)
wait(5)
InitiateStartUp()