Attempt to concatenate string with nil

localscript

QueueGUI.MainFrame.ScrollingFrame.ChildAdded:Connect(function(v)
	print("we found "..v.Name)
	local lobbyname = v.LobbyName.Text
	v.ImageButton.Activated:Connect(function()
		print(v.LobbyName.Text)
		PressQueue(lobbyname)
	end)
end)

server

Queue.OnServerEvent:Connect(function(Player,LobbyName)
	QueueModule.JoinLobby(Player, LobbyName)
end)

module

function queuelib.JoinLobby(plr,lobbyname)
	print(plr.Name .." joined lobby " .. lobbyname)
end

what im looking into with the localscript function
image

Where’s the part where you are firing it to the server?

2 Likes

which exactly line is being passed and does return this error? :grinning:

the localscript, the pressqueue() its a remote event

ReplicatedStorage.Modules.QueueModule:65: attempt to concatenate string with nil

and the line that i sent you is being passed in the module portion

Well, show the code inside the function, I wan see what you send off to the server

Like @Mystxry12 has said. We need to see the part where you are firing the Queue remote event to the server with the function. Make sure you are passing one argument from the client to the server which is the lobby name.

off of memory its

local function PressQueue()
local Queue = game.ReplicatedStorage.Remotes.Queue
Queue:FireServer()
end

i probably need to pass in the variable to the local function right

Change the function to this:

local function PressQueue(LobbyName)
local Queue = game.ReplicatedStorage.Remotes.Queue
Queue:FireServer(LobbyName)
end

ah yes okay no wonder its spitting nil at me, ill try that in a minute

1 Like

that was it LOL, thank you my brain is out the window rn

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.