Hello, I am trying to make a Room Keycard system but I am coming up on some difficulties.
- The system itself somewhat works, since I get the tool and the tool gets the name, but the ToolTip is just nil, and there is no output message or error.
local Repl = game:GetService("ReplicatedStorage")
local GiveRoom = Repl.Events.GiveRoom
local Players = game:GetService("Players")
local RoomMetadata = {
TotalRooms = {};
AvailebleRooms = 12;
StartRoom_Number = 100;
};
Players.PlayerAdded:Connect(function(Player)
local HasRoom = Instance.new("BoolValue")
local RoomNumber = Instance.new("NumberValue")
HasRoom.Parent = Player
RoomNumber.Parent = HasRoom
HasRoom.Name = "HasRoom"
RoomNumber.Name = "RoomNumber"
end)
GiveRoom.OnServerEvent:Connect(function(Player, value)
local Room_KeyTemplate = Repl.KeyTemplate
if not table.find(RoomMetadata.TotalRooms, value) then
table.insert(RoomMetadata.TotalRooms, value)
RoomMetadata.AvailebleRooms -= 1
local Key = Room_KeyTemplate:Clone()
Key.Parent = Player:WaitForChild("Backpack")
Key.ToolTip = tostring(value)
Key.Name = "Room Key"
else
return false
end
end)