✓ Accepted answer
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
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!
4 comments
You shouldn't really be using lighting for storage, other services (serverstorage) exist for that reason
ok
that doesn't help with what I am asking tho
He's just giving you a tip on how stuff should be stored for better use. ReplicatedStorage and ServerStorage are better for storing items to be cloned and used.