so I am trying to make an egg that when the player clicks it or touches it (whatever works easier) they get the egg in there backpack and the after 5 minutes the egg re-appears at the spot. Any way to make this work is welcome but I assume I could use a script that clones to backpack and makes Transparency = 1 and CanCollide = false and then wait(300) seconds and "Re-Appears" or becomes seen and able to collide. I have had difficulties trying multiple methods and would like someone with coding knowledge for help. Any help is greatly appreciated.
function onTouched(hit)
local pos = script.Parent.Position
if script.Parent.CanCollide == true and hit.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(hit.Parent.Name) then
script.Parent.Transparency = 1
script.Parent.CanCollide = false
local plr = game.Players:FindFirstChild(hit.Parent.Name)
local place = plr.Backpack
local clone = script.Parent:Clone()
clone.Parent = place
wait(300)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end
end
script.Parent.Touched:connect(onTouched)
This is one script that seems like it should work but didnt. Feel free to use a completely different way. All I need is an egg that can be collected and re-appears after 5 minutes.

1 comment
If you clone a script's parent, the script will be cloned as well, thus repeating the process.!