local Players = game:GetService("Players") local collected = {} for _, crystal in workspace:WaitForChild("QuestCrystals"):GetChildren() do if not crystal:IsA("BasePart") then continue end crystal.Touched:Connect(function(hit) local character = hit:FindFirstAncestorOfClass("Model") local player = character and Players:GetPlayerFromCharacter(character) if not player then return end local seen = collected[player] or {} collected[player] = seen if seen[crystal] then return end seen[crystal] = true local total = (player:GetAttribute("QuestCrystals") or 0) + 1 player:SetAttribute("QuestCrystals", total) player:SetAttribute("CrystalQuestComplete", total >= 3) end) end Players.PlayerRemoving:Connect(function(player) collected[player] = nil end)