Quest system not working

I made a quest system that whenever you kill an enemy, 1 is added to your kills for the quest. However, it doesn’t add anything. No errors at all. Please help me!

Script:

for _, enemy in pairs(workspace.Enemies:GetChildren()) do
	enemy.Humanoid.Died:Connect(function()
		if enemy.Humanoid:FindFirstChild('creator') then
			print('yes1') -- prints
			local player = enemy.Humanoid.creator
			if enemy:FindFirstChild('QuestValue') then
				print('yes2') -- prints
				if enemy.QuestValue.Value == player then
					print('yes3') -- doesn't print?
					player.QuestProgress.Value += 1
				end
			end
		end
	end)
end

There are quest values + creator tags in the enemy’s humanoid:
Screenshot 2022-08-10 at 4.52.51 PM
Screenshot 2022-08-10 at 4.52.56 PM
Screenshot 2022-08-10 at 4.53.01 PM
And there is a number value called QuestProgress in the player. Please help me

1 Like

Do:

if enemy.QuestValue.Value == player.Name

and see if that works.

1 Like

Its an object value so that wouldnt work

Change

local player = enemy.Humanoid.creator

To

local player = enemy.Humanoid.creator.Value

the enemies quest value is also an object value with the value being the player

Thank you so much, I can’t believe I missed that.

Your welcome, glad I was able to help!