I have a script that allows you to grab an item by touching it, but when one player clicks it no one else can. Here is my script.
function touch(x) local y = x.Backpack local z = game.Lighting["[SCP] Card-L2"] z:Clone().Parent = y script.Disabled = false script.Parent.ClickDetector.MaxActivationDistance = 0.5 end script.Parent.ClickDetector.MouseClick:connect(touch)
Some parts of your script doesn't need to be there, and can be manually done in the properties section of the Script and ClickDetector part.
This is what I wrote, and it works perfectly fine.
local debounce = true local cooldown = 10 --// Change this to the number (seconds) in which they have to wait to click it again script.Parent.ClickDetector.MouseClick:Connect(function(clicker) if clicker ~= nil and debounce == true then debounce = false local card = game:GetService("ReplicatedStorage"):WaitForChild("[SCP] Card-L2"):Clone() card.Parent = clicker.Backpack wait(cooldown) debounce = true end end)
The only thing you have to change inside the script is the cooldown to how long you want them to wait for them to click it again.
And like turtle2004 said, "You shouldn't really be using lighting for storage, other services (serverstorage) exist for that reason."
ReplicatedStorage and ServerStorage are better for storing items to be cloned and used.
Lighting is for visual effects like blur, sky, etc.
Hope this helped, if it worked then use this as the answer. If it didn't, comment down below what the error is and I'll try to fix it!