Hello, I am working on this click regen that gives you a tool once you click. Now would there be anyway to make it where you keep the item after death?
local itemname = "Flashlight"
local item = game.Lighting:findFirstChild(tostring(itemname))
local trigger = script.Parent
enabled = true
function onClick(plyr)
if plyr.Backpack:findFirstChild(tostring(itemname)) == nil and enabled == true then
enabled = false
trigger.BrickColor = BrickColor.new("Black")
local itemclone = item:clone()
itemclone.Parent = plyr.Backpack
wait(2)
enabled = true
trigger.BrickColor = BrickColor.new("Black")
end
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
