I’m trying to make a script that when you join, if you have a certain ID, your character changes to another one, but i just made the game unplayable…
Here’s the script:
game:GetService("Players").CharacterAutoLoads = false
local function onPlayerAdded(player)
if player.UserID == 1929382694 then
player:LoadCharacterWithHumanoidDescription(game.Workspace.SpecialAvatars.HumanoidDescription1)
else
game:GetService("Players").CharacterAutoLoads = true
end
end
game.Players.PlayerAdded:Connect(onPlayerAdded)
When i join, the game loads, but i cant move, zoom-in/out my camera, all i can do is interact with the default UI’s (it looks like when the game is loading but the loading UI didn’t loaded yet)
CharacterAutoLoads is a property that determines if the character will spawn by itself or not.
Since you disabled it for the user having that userID, and reenabled it for others, it won’t spawn that user
CharacterAutoLoads prevents RŌBLOX from spawning a character itself. You must spawn the user using LoadCharacter every time the user has to respawn
However, in your case, you called LoadCharacterWithHumanoidDescription immidiately after player joined. The player is likely not yet fully loaded and not ready to spawn yet. You should wait until the player is ready.
Note that also that user won’t respawn unless you load his character again if he dies, since auto load is disabled