Can anyone explain this bug?

Hello, just wanted to know how do i fix this bug? Basically, i am trying to make a quest npc and it just does not work, heres what i did.

script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
local chat = game:GetService(“Chat”)

	chat:Chat(script.Parent.Parent.Head, "Your Current Quest is Catch The Ancients")
	workspace["Ralsei Talking Sound"]:Play()
	if plr.Backpack:FindFirstChild("The Ancients") == true then
	chat:Chat(script.Parent.Parent.Head, "Quest Completed")
		plr.Backpack["The Ancients"]:Destroy()
		plr.leaderstats.Credits.Value += 5000
		print("You Have The ancients")
	else
	chat:Chat(script.Parent.Parent.Head, "You dont have The Ancients in your Backpack")
	end
end)

DEEE

Do anyone know how to fix that?

2 Likes

Oops this is the actual script:

script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
local chat = game:GetService(“Chat”)

	chat:Chat(script.Parent.Parent.Head, "Your Current Quest is Catch The Ancients")
	workspace["Ralsei Talking Sound"]:Play()
	if plr.Backpack:FindFirstChild("The Ancients") == true then
	chat:Chat(script.Parent.Parent.Head, "Quest Completed")
		plr.Backpack["The Ancients"]:Destroy()
		plr.leaderstats.Credits.Value += 5000
		print("You Have The ancients")
	else
	chat:Chat(script.Parent.Parent.Head, "You dont have The Ancients in your Backpack")
	end
end)

Bruh. just to let yall know, the script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
local chat = game:GetService(“Chat”) is part of the script.

You are comparing a type Instance? to a type boolean.
Remove the == true and that should fix it.

2 Likes

I removed the == true and it worked! Thank you so much.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.