My script is suppose to print 3 names but only prints 1 which is the “Serve 3 customers”
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local dQuestsFolder = ReplicatedStorage:WaitForChild("DailyQuests")
local quests = {
dQuestsFolder.Mop5;
dQuestsFolder.Play10Min;
dQuestsFolder.Serve3;
}
game.Players.PlayerAdded:Connect(function(player)
local questsFolder = Instance.new("Folder")
questsFolder.Name = "Quests"
questsFolder.Parent = player
player.CharacterAdded:Connect(function(character)
for i, quest in pairs(dQuestsFolder:GetChildren()) do
if not questsFolder:FindFirstChild(quest.Name) and not quest:FindFirstChild("Completed") then
wait(.1)
local questClone = quest:Clone()
questClone.Parent = questsFolder
print(questClone.Name)
if questClone:FindFirstChildOfClass("Frame").QuestName.Text == "Play for 10 minutes" then
local timePlayed = Instance.new("IntValue")
timePlayed.Name = "TimePlayed"
timePlayed.Parent = player
repeat
timePlayed.Value += 1
task.wait(1)
until timePlayed.Value == 600
local completed = Instance.new("BoolValue")
completed.Name = "Completed"
completed.Parent = questClone
timePlayed:Destroy()
elseif questClone:FindFirstChildOfClass("Frame").QuestName.Text == "Serve 3 customers" then
local customersServed = Instance.new("IntValue")
customersServed.Name = "customersServed"
customersServed.Parent = player
repeat
task.wait(1)
until customersServed.Value == 3
local completed = Instance.new("BoolValue")
completed.Name = "Completed"
completed.Parent = questClone
customersServed:Destroy()
elseif questClone:FindFirstChildOfClass("Frame").QuestName.Text == "Mop 5 spills" then
local spillsMopped = Instance.new("IntValue")
spillsMopped.Name = "spillsMopped"
spillsMopped.Parent = player
repeat
task.wait(1)
until spillsMopped.Value == 5
local completed = Instance.new("BoolValue")
completed.Name = "Completed"
completed.Parent = questClone
spillsMopped:Destroy()
end
end
end
end)
end)