#quest system bug

1 messages · Page 1 of 1 (latest)

oak sentinel
#

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

#

i need help

#

oh my misery

crude dirge
#

first thing, do this

#

and this

#

and you have to disconnect the function after its used

#

i may be spittin bs cuz its 1 am but doesnt hurt to try coolguy