PlayerAdded/CharacterAdded issue

Hello.

I Need help with one horrible bug with the engine NEVER firing “PlayerAdded” event on studio.
and never firing “CharacterAdded” On both live servers and studio.
i have tried everything to fix the bug and it just never fire this broke my entire game because roblox IS UNABLE to make an game engine that functions properly.

local function PlayerStartup(Player: Player)
	Player.CharacterAdded:Connect(function(char: Model)
		AddLoadouts(Player)
	end)
	AddLoadouts(Player)
end

for _,Player in Players:GetPlayers() do
	PlayerStartup(Player)
end



Players.PlayerAdded:Connect(PlayerStartup)

(i didnt add the other function because on itselfs it works)
please help me i cant figure this out

3 Likes

Whats the type of the script and where is it located? It works fine for me

1 Like

Basically the script is supposed to give the player overhead tags and weapons upon spawning.
(theses tags are customized for every single players) what i mean is that they can set multiple groups with their role in the group as the tag.
this function itself (AddLoadouts) entirely works.
The rest nah it never works.
its an server script

1 Like

what doesnt work is well… THE CHARACTERADDED event it never fires

1 Like

Server Script located where?
Can you share the rest of the code? Or try running this

local Players = game.Players

local function PlayerStartup(Player: Player)
	Player.CharacterAdded:Connect(function(char: Model)
		print(Player)
	end)
	print(Player)
end

for _,Player in Players:GetPlayers() do
	PlayerStartup(Player)
end



Players.PlayerAdded:Connect(PlayerStartup)
1 Like

none of them prints… im so done with this fu**ing game engine that is unusable

1 Like

Are you trying to get help or did you create this post just to blame roblox studio? Where are you placing this script

1 Like

i already told you… the script is in serverscriptservice

the event decided to fire after like 30 attemps and some peoples are glazing studio bc its good hell naw (how can i avoid doing the players loop stuff im forced to do it because playeradded never fires in studio)

this didnt help but the issue is now fixed (kinda) thanks for trying to help!

Swearing for no reason is crazy work

1 Like

this is particular to the single play mode in studio, it uses your computer as both the server and client at the same time, because of the sequence of initialization, the player and its character is already ‘added’ before the server side is initialized.
and so in this particular mode, your own PlayerAdded and the first CharacterAdded are not fired. (and roblox confirmed that cannot be fixed this without other major workover)
so the workaround is that we use a loop to call the PlayerAdded and CharacterAdded on all current players and characters at least once.