I have a script that allows a player to click on an object and then receive the clone of that object from lighting. I want to make it seem like that item will "respawn" after a set amount of time. Previously I just destroyed the part but I want other players to be able to pick it up again after a cooldown but I'm not sure how to do that.
local Part = script.Parent
Toolname = "SCP_LEVEL1"
function boop(Player)
if not Player.Backpack:FindFirstChild("SCP_LEVEL1") then
local Tool = game.Lighting.SCP_LEVEL1:Clone()
Tool.Parent = Player.Backpack
wait (5)
-- Not sure what to put here to make it invisible then visible again
end
end
script.Parent.ClickDetector.MouseClick:connect(boop)

2 comments
just use transparency to make it go invisible, "Part.Transparency = 1" to make it go invisible, then "Part.Transparency = 0" to make it appear again, sorry if this is incorrect I'm fairly new to coding myself
also if you want to make it so they can only pick it up after a certain amount of time, look into a thing called "debounce"