Text returns as a table

I am sorry in advance as this is very messy.

I keep getting this error, but it’s not a table

https://gyazo.com/f8f15e546734359450d21a14610e0e04
https://gyazo.com/456993afcf9a8b270700598d4e42cf6f https://gyazo.com/934e8191fd4061832ca4282f8a04afb4 https://gyazo.com/ef8dab66123b5f3d94e724694bbfa94c https://gyazo.com/63ab3938fc39ef3c0c5b08bd6e068d56 https://gyazo.com/075580afaee863f8c1a4c12a598c7228

The error is in the 1st picture
The OnClientEvent is in the 2nd Picture
The Function being fired is the 3rd picture
The Username variable is the 4th picture
The function is the 5th Picture
The OnServerEvent is the 6th picture

and it stays as Text, but returns as a table?

as I said, this is very messy and I am extremely sorry.

Cleaned up this post a little bit:

456993afcf9a8b270700598d4e42cf6f

934e8191fd4061832ca4282f8a04afb4

ef8dab66123b5f3d94e724694bbfa94c

63ab3938fc39ef3c0c5b08bd6e068d56

1 Like

Have you tried to iterate through the table to see what you get as results?

Don’t see anything wrong yet (unless I’m going blind), just curious what the table would be.

You called Functions:AddUnit using the colon syntax, which essentially made you call that function like this:

Functions.AddUnit(Functions,username)

You have to redefine the AddUnit function from the fifth picture to look like this:

module.AddUnit = function(self,username)
	Events:WaitForChild("AddUnit"):FireServer(username)
end

--alternatively, more readable:

function module:AddUnit(username)
	Events:WaitForChild("AddUnit"):FireServer(username)
end

The other option is just to use the dot syntax when calling AddUnit, probably much easier:

Functions.AddUnit(username)
2 Likes