nights = {[1] = "monster1",[2] = "monster2"}
Client
game.ReplicatedStorage.start:FireServer(v.Name)
Server
game.ReplicatedStorage.start.OnServerEvent:Connect(function(n)
for i,model in pairs(game.ServerStorage:GetChildren()) do
if string.match(nights[tonumber(n)],v.Name) then
model:Clone().Parent = workspace
end
end
end)
output
ServerScriptService.send:61: bad argument #1 to 'match' (string expected, got nil)
Basically the client is sending a object's name, The server is going through the table and seeing if the string matches with any children in server storage If there's a easier way to do this please tell me, This is really confusing ;'/

1 comment
n, is the name of an object right? You are trying to turn that name (String) into a Integer (Number), and you cannot do that, you can turn Integers into Strings, but not vice versa. Unless, that name of the object is 1 or 2.