I am having problem to find the specific item in my game called "keyTorch". This makes item get held by player if picked and also toggles the color of eye of totem pole but after it is picked i cant find a way to define this object. also, this game is parkour-type game so i have my model in serverstorage to spawn new one in case the player falls and is lost, but cant find a way to know if the torch is really lost or is held by player. sorry for my bad grammars.
--code (for checker to see if the key is held by player or it is lost) local totemEye1 = script.Parent.eye1 local totoemEye2 = script.Parent.eye2 local players = game.Players local originalkeyTorch = game.ServerStorage:WaitForChild("keyTorch") local originalkeyPosition = originalkeyTorch.Handle.Position local keyTorchLostDetector = script.Parent.keyLostDetector local torchBackDetector = script.Parent.Parent.torch1Checker local keynotDestroyed = true local keystolen = false keyTorchLostDetector.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid")then print("the visible key torch is about to get stealed by player") wait(20) if game.Workspace:FindFirstChild("visiblekeyTorch")~= game.Workspace then print("the key is not in original Place") keystolen = true if [[--apperantly this part doesn`t work--]] game.Workspace:FindFirstChildOfClass("Model"):FindFirstChild("visiblekeyTorch") or game.Workspace:FindFirstChildOfClass("Model"):FindFirstChild("BackPack"):FindFirstChild("visiblekeyTorch") then print("the key is in player") else print("the key is not found") keystolen = false local cloneKey = originalkeyTorch:Clone() cloneKey.Name = "visiblekeyTorch" cloneKey.Parent = game.Workspace print("the key was loaded") end end end end)