#I'm a bit lost with this loop that's meant to iterate through players and apply cosmetics.

17 messages · Page 1 of 1 (latest)

fair mortar
#

I've been stuck on an issue for a long while and I can't find any solution, though I think I'm getting close. Basically how it works is when a player clicks a customization option, its sent to a server script to store the player's name in a dictionary, and then their accessories in an array, so every player has a spot in the table and their accessories.

At one point this worked on 1 player, but didn't work when there were more than 1 player, but all the sudden it doesn't work at all and I'm pretty sure it's the exact same as I left it.

Any help is appreciated!

#

Also, when I print it, it does show that the table is how it should be.

#

Same with multiple players too.

turbid junco
#

Inside character added function you can use a parameter called 'Character'

#

This comes with the CharacterAdded function

#

Don't use player.Character inside the CharacterAdded

fair mortar
#

Oh damn, I didn't know that, does this look right?

#

Well wait, does CharacterAdded work on every player in the game?

#

Or do I use it to check a specific CharacterAdded

#

Because I thought it was a specific player

blissful ravine
#

@fair mortar i think the problem lies in the implementation of how you apply the settings

lets suppose the server script ran before any player joined. The :GetPlayers() wouldn't get shit.

or your script could run after a certain player joined but the other didn't, those player ain't gonna see any change

#

you want to address a total of two outcomes

if there are any players that have already joined before this script runs. (you are doing it in the for loop)

if any player joins after the script ran. you can do this by using the
.PlayerAdded

fair mortar
#

Ohh right, let me try changing that too

#

I'm not sure why it doesn't work in general anymore even though the code hasn't changed, but it's probably some weirdness because of that

blissful ravine
#

its as i have explained, when you were testing before it could be that the script ran after you were already in the game

now it sometimes the script could also run before you joined the game, in that case it wouldn't show the desired result you are looking for

fair mortar
#

Oh thank god, it works now, thank you

#

I've been trying to fix this for a week lol, I'm not used to the stuff running only once