I am attempting to make an item (it is a union part that is stored in Server Storage by default) that gives the player more points when touched, then is destroyed and returns 5 seconds later. I am able to make the item give points when touched and get destroyed, but the problem is with the regenerating and being able to generate the .Touched event after the first time. My script currently spawns in the chest, and when touched gives my character more points, but does not respawn afterwards. I believe the issue is with the way I am identifying the object from the Server Storage or I am using the clone incorrectly. Any advice would be appreciated!
local trez50 = game.ServerStorage.TreasureChest50:Clone()
trez50.Parent = game.Workspace
trez50.Touched:Connect(function()
trez50:Destroy()
money.Value = money.Value + 50
wait(5)
trez50.Parent = game.Workspace
end)

1 comment
Forgot to add, but I get this error, " The Parent property of TreasureChest50 is locked, current parent: NULL, new parent Workspace" after waiting the 5 seconds. I assume that only one clone is made and therefore when it is destroyed after being touched, the game is unable to access it. I now feel like I'm just having a big brainfart, but I would still love some help!