In my place, I'm using keycards to open doors. However, it's not working as I want it. I'll add notes in the script to tell you as I go along.
Group = 1015675
Key = script.Parent.Keycard
function ForgeKey(LevelToPrint, Player)
NewKey = Key:Clone()
NewKey.Parent = game.Players:FindFirstChild(Player.Name).Backpack
Folder = script.Parent.CardProperties:FindFirstChild("Level "..LevelToPrint)
NewKey.Handle.BrickColor = Folder.Colour.Value
NewKey.Handle.Reflectance = Folder.Reflectance.Value
NewKey.Level = LevelToPrint
end
game.Players.PlayerAdded:connect(function (plyr)
plyr.CharacterAdded:connect(function (char)
if plyr:IsInGroup(Group) then
Rank = plyr:GetRankInGroup(Group)
if Rank < 50 then
ForgeKey(1, plyr)
elseif Rank == 52 then
ForgeKey(3, plyr)
elseif Rank < 200 then
ForgeKey(2, plyr)
elseif Rank == 202 then
ForgeKey(4, plyr)
elseif Rank < 253 then
ForgeKey(4, plyr)
elseif Rank > 252 then
ForgeKey(5, plyr)
end
end
end)
end)
Anyone see where I faltered? Thanks in advance.

8 comments
On line 7, you should be using
BrickColorinstead of "Color".I don't see anything wrong with the code, what exactly isn't working properly?
It's simply not giving it to the player when they join. (I AM testing this online, by the way) Something may have faltered beforehand but I don't know.
I put in some corrections. It's still not working though.
Line 6 can be just "Player.Backpack" no need to search for it.
Okay. Anything else?
Part of your problem may be having spaces in the name of the Levels in the CardProperties. Try removing the spaces, and editing your script accordingly.
Seems to make no difference.