0

# Can I use FindFirstChild on a cloned tool?

Asked by 15 days ago
Edited 15 days ago

So, I asked a related question a few days ago and got an answer which worked but only for when the tool i'm referencing is in workspace.

WORKS FINE (read on)

local player = game:GetService("Players").LocalPlayer
local char = player.Character
local prompt = game.Workspace.Smelt.ProximityPrompt
while wait(0.1) do
if player.Backpack:FindFirstChild("Malachite Chunk") or player.Character:FindFirstChild("Malachite Chunk") then
prompt.Enabled = true
else
prompt.Enabled = false
end
end


This script works fine because "Malachite Chunk" is in Workspace and it hasn't been cloned, but when I try to do the same thing but referencing a tool in ReplicatedStorage it gives me the error "Attempted to index nil with FindFirstChild" For more context, The proximityprompt's script is cloning the item from ReplicatedStorage and giving it to the player whilst also removing the previous item that is required for the prompt to show up when pressing E.

Any help or ideas would be greatly appreciated because I can't come up with a solution to this.