Im creating a game in which when you touch a part you get a tool that is saved on the replicated storage. But i don’t want the tool to duplicate, because now you can get as tools as you want by interacting with the block.
So I need help on scripting a system that when you interact with the part it checks if you have the tool that the part gives, and if you have the tool it doesen’t give it, and if you don’t, it gives the tool.
I’ve tried different options but im new at scripting so they don’t work. Below you have the script inside the Proximity Prompt that is inside of a Part.
script.Parent.Triggered:Connect(function(player)
local Pack = player.Backpack
local RepStorage = game:GetService("ReplicatedStorage")
local Item = RepStorage:WaitForChild('RPG')
local ClonedItem = Item:Clone()
ClonedItem.Parent = Pack
end)
Thanks in advance