This is my code:
--//Service
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Players = game:GetService('Players')
--//Variables
local Player = Players.LocalPlayer
local Keycards = ReplicatedStorage.Keycards:GetChildren()
--//MainScript
script.Parent.MouseButton1Down:Connect(function()
if Player.Backpack:FindFirstChild('Keycard') == nil then
if Player.Character:FindFirstChild('Keycard') == nil then
local GetKeycard = Keycards[math.random(1, #Keycards)]
GetKeycard.Parent = Player.Backpack
end
end
end)
The problem with this code is that another person who clicks the GUI will get the card even if it is owned. I would only like the card available to one person in the whole server, basically just one different card per person.
Any help please?

1 comment
Anyone help, please?