Hi, so I’m making a Check-in system so I can have one for my hotel!
The only issue is, it doesn’t work.
The issue is, it’s not giving the Keycard.
The event fires perfectly, it just doesn’t give the card.
I’ve tried making multiple keys, that didn’t work and I didn’t get any output errors.
Where have I gone wrong?
local Tool = game.ServerStorage.S101
local ToolClone = Tool:Clone()
local Handle = ToolClone.Handle
local rooms = {
S101 = nil,
S102 = nil,
S103 = nil
}
game.ReplicatedStorage.CheckIn.OnServerEvent:Connect(function(plr, name, reason)
for i, thePlr in pairs(game.Players:GetChildren()) do
if string.match(thePlr.Name, name) then
for i, v in pairs(rooms) do
if v == thePlr.Name then
return
end
end
for room, v in pairs(rooms) do
if v == nil then
v = thePlr.Name
local ToolClone = Tool:Clone()
local Handle = ToolClone.Handle
ToolClone.Parent = thePlr.Backpack
ToolClone.Name = i
end
end
end
end
end)