0 views0 copies0 likes
Quest Progress Counter for Crystal Hunts
Universal script
Copy it, then test it in your own Studio place.
Script code
18 lines ยท 0.8 KBlocal 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)-- โฆopen Get script for the full sourceAbout this script
Add anchored parts inside Workspace.QuestCrystals. Collecting one for the first time increments the player's QuestCrystals attribute. The tracked crystals are personal even though the parts remain visible to everyone. At three crystals, CrystalQuestComplete becomes true for your reward handler to read. Try having two players collect the same crystal and verify that each keeps their own progress.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.