Have you ever played adventure forward: Star Savior? I want to make a system as they make for their stars. I already have worked out a script. It works...
num=0
function T(hit)
name=hit.Parent
players=game:GetService("Players")
player=players:findFirstChild(name.Name)
if player.leaderstats.Gems.Value<=num then
local gems=player.leaderstats.Gems
gems.Value=gems.Value+1
end
end
script.Parent.Touched:connect(T)
This will award the gem to the player ONLY if the player has 'num' or less gems.
Here's my problem.
I want the player to collect gems in any order. I can't do temp data, either, because the data saves. I need a way for you to only be able to collect each gem once, but be able to collect them in any order.
Thank you for your time.

2 comments
Why don't you use
GetPlayerFromCharacter?I like to mix things up. Actually, it's just instinct.