This code works until the character dies and then respawns. If they click on the item once they have respawned I get this error " The Parent property of Science is locked, current parent: NULL, new parent Backpack" And it will not clone the item into the players backpack. The only thing I could find in Wiki was that a parent property locked and set to null on an instance happens when an object is removed or destroyed, which would obviously happen when the player dies, so why would that error occur once a character respawns and how can I fix that?
local RE = game.ReplicatedStorage
local event = RE.Notify
local event2 = RE.ScienceEvent
local klone = game.ServerStorage:FindFirstChild("Science"):Clone()
db = false
event2.OnServerEvent:Connect(function(plr)
if db == false then
db = true
if klone.Parent ~= plr.Backpack then
klone.Parent = plr.Backpack
event:FireAllClients(plr.Name.." found the Science Room Key!")
end
wait(35)
db = false
end
end)
--Here is the local script
local clickdetector = game.Workspace.Science.h.ClickDetector
clickdetector.MouseClick:Connect(function()
game.ReplicatedStorage.ScienceEvent:FireServer()
end)

2 comments
try putting local 'klone = game.ServerStorage:FindFirstChild("Science"):Clone()' inside the event2 function in the script
Thank you, thank you Vlym. That worked!!! YAY :)