Basically, if player touches the part "Purple" and if player has the ClassicSword, a print should appear "There is a sword"
local Detector = script.Parent.ClickDetector
local Tool = game.ServerStorage.ClassicSword
local Part = workspace.Purple
Detector.MouseClick:Connect(function(Player)
local Clone = Tool:Clone()
Clone.Parent = Player.Character
Part:Destroy()
end)
workspace.Purple.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Backpack:FindFirstChild("ClassicSword") then
print("There is a sword")
end
end
end)

6 comments
It still doesn't work :/
Did you touch the Purple part first or click the button first?
I'm trying both ways
@EEnergy8 You're cloning the item to the character not the player's backpack
Cloning an item to the character automatically puts it in their backpack and equips it.
I edited it. Now see if it works.