I have an OnPlayerAdded and CharacterAdded function that I only want to happen when the player joins. How can I do this?
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) print(plr .. "spawned") end) end)
You are mostly correct but the Character may already be loaded. Try this instead:
game.Players.PlayerAdded:Connect(function(plr) local char = plr.Character or plr.CharacterAdded:Wait() print(plr.Name .. " spawned for the first time!") end)
If this worked, make sure to mark it as correct/upvote! Thanks!