So I have a function that triggers when a player joins the game, and then another when the player spawns in. The problem is that whenever I add function to run after someone joins, the rest breaks and the function that listens for player spawns stops working.
game.Players.PlayerAdded:Connect((function(player)
--this will activate when a player joins the game for the first time ^^^
print(player.name .. " joined the game!");
playerCount = playerCount + 1
StatInit(player)
FirstJoinCheck(player)
JoinIncrement(player)
player.CharacterAdded:connect(function(character)
print(character.Name .. " spawned into the game!");
--this event will activate when a player "joins" the game (liike after respawning) ^^^
this breaks ^^
game.Players.PlayerAdded:Connect((function(player)
--this will activate when a player joins the game for the first time ^^^
print(player.name .. " joined the game!");
player.CharacterAdded:connect(function(character)
print(character.Name .. " spawned into the game!");
this doesn’t ^^
It doesn’t actually error, and it runs code written after the functions in that same block of code, just not where it listens for a player spawn.