if you write print(game.Players.Name)
it will return Players
because that is the name of the service Players.
so the error means there is no wheat Patch under the name ‘Players’
script.Parent.ProximityPrompt.Triggered:Connect(function(player)
local Backpack = player.BackPack
local Tool = Backpack:WaitForChild("Sickle")
if Tool then
print("Tool exists")
else
print("Tool doesn't exists")
end
end)
Did a tiny tweak (Line 1, and changing BackPack → Backpack) and it works! Thank you so much!
script.Parent.Triggered:Connect(function(player)
local Backpack = player.Backpack
local Tool = Backpack:WaitForChild("Sickle")
if Tool then
print("Tool exists")
else
print("Tool doesn't exists")
end
end)
When the item is equipped, its parent switches to the player instead of the Backpack. How can I check the player instead of the backpack? I tried replacing
When the tool is equipped it is parented to character.
This should work
script.Parent.Triggered:Connect(function(player)
local character = player.Character
local Tool = character:FindFirstChild("Sickle")
if Tool then
print("Tool exists")
else
return
end
end)