Help with enemy dropping tools

Go on Line 333, In this case it tells you that Prompt is not a part of Classic Sword, have you checked if the prompt is present?

These are lines 333-349. Everything looks fine. Prompt is present inside of the tool.

reward.Prompt.Parent = anchor
					
					anchor.Prompt.Triggered:Connect(function(player)
						touched = giveItem(reward.Name, recipient)
						
						model:Destroy() -- Remove model after collected
						sendInventoryUpdate(player)
					end)
				end

Do you do like commissions or anything?

Here’s what’s going on in the script.

reward.Prompt.Parent = anchor -- This is the Classic Sword you defined here.
--And it tells us that "Prompt" isn't a part of Classic Sword
--Try adding either a WaitForChild to wait for the prompt to be a part of anchor (Classic Sword) or use FindFirstChild to check if it's present
local Prompt = anchor:WaitForChild("Prompt")
					Prompt.Triggered:Connect(function(player)
						touched = giveItem(reward.Name, recipient)
						
						model:Destroy() -- Remove model after collected
						sendInventoryUpdate(player)
					end)

Still doesn’t work unfortunately. He drops it the 1st tike but wont drop it again.

But it shouldn’t print an error now, correct?

I just dont get why he drops it once but not after that. It says its not a prt of classic sword but it still drops the first time.

Did you do as I said, by using WaitForChild?

I used both waitforchild and findfirstchild. same results for both.

Show me the part of the script again please.

this is what you meant by adding waitforchild or findfirstchild?

Correct but is your trigger using it?

It for sure won’t print the same error, telling you that Prompt isn’t a part of Classic Sword, if you used WaitForChild.

How would you add a waitforchild in that line of code though?

local Prompt = anchor:WaitForChild("Prompt")
Prompt.Triggered:Connect(function(player)
	touched = giveItem(reward.Name, recipient)
	
	model:Destroy() -- Remove model after collected
	sendInventoryUpdate(player)
end)

Yes i added that part but i still got the prompt not a valid member error. It has to be somewhere else in the code at this point.

You already know what to do then. :slight_smile:

hm? I already know what to do?

Yea, for every error you fix, if a new one pops up, just fix that and proceed until there’s no errors. :slight_smile:

Edit: If you need help with any of them. Post the new error in a new reply in this thread, and also post the part of the script that errors.

The only error is the prompt isnt a part of classic sword

Please send me the output, and the lines again.