sometimes when I try to do the quest multiple times it seems to be stuck at a certain value and no matter how many enemies i kill it doesnt go up
function questCreation(enemies)
if player then
for _, ui in questGui:GetDescendants() do
if ui:IsA("Frame") or ui:IsA("TextLabel") then
ui.Visible = true
end
end
for _, enemy in enemies:GetChildren() do
if enemy:FindFirstChild("Humanoid") then
enemy.Humanoid.Died:Connect(function()
kills += 1
progressText.Text = tostring(kills).."/5"
local tween = ts:Create(questFrame, tweenInfo, {Size = UDim2.new(kills/5,0,1,0)})
tween:Play()
if kills >=5 then
game.ReplicatedStorage.remotesFolder.questRewardEvent:FireServer(player)
print("kills has been reset")
kills = 0
local resetTween = ts:Create(questFrame, tweenInfo, {Size = UDim2.new(0, 0, 1, 0)})
resetTween:Play()
for _, ui in questGui:GetDescendants() do
if ui:IsA("Frame") or ui:IsA("TextLabel") then
ui.Visible = false
progressText.Text = "0/5"
questTaken = false
end
end
end
end)
end
end
end
end
