#Table.insert(tab,player.UserId) adding both the player's ID and Name for no reason
61 messages · Page 1 of 1 (latest)
where is the table insert
Im on mobile. Here’s the gist, I have a functional called PlayerState.AddIG(player) table.insert(STATEBANK.INGAME, player.UserId)
What’s happening is, I’ve already added the player. So when I do GetIG I get the table which should be full of UserIds only and use it in the larger function at the top of the post
I explicitly add only the UserId but it adds player name too for some reason
This is the error I got
so there shouldn't be any duplicates of table.insert right?
might as well use ctrl + f and find any duplicates if you can access studio
I will probably have to do that in the morning
But I’m 100% sure that these PlayerState functions are the only ones that can access the STATEBANK
I’ll have to check game mode scripts
Or voteStart
At some point I have to move Lobby players to Ingame, so an error may have occurred there
alr for now I put a pcall on it so it doesn't stop th ecode
i mean okay
not a good long-term solution
but if you wanna focus on something else first you could do that
What else would I do
I have it only add UserId and it keeps adding my username with it
can't seem t ofind out what the problem is
you should show the entire script if you want
the error is occuring in this function:
Having errors with my INGAME table
Shows it is only adding UserId
and what code is in it
** You are now Level 5! **
im only adding UserId, but it also adds my name too
so weird!
The printout for Output
this is the Ingame table
It should only have my ID
but it also has my name
this only means your player instance is being inserted right after the user id
I will search
will get back to you
found the issue
inserting player and not player.UserId
I made this function assuming argument #1 is already a UserId, so now I will have to go through each script and find the ones that are using this function and change the arguments accordingly