Why does my avatar change back to normal?

(NOTE: IF THIS IS THE WRONG CATEGORY PLEASE TELL ME) Hi I wanted to ask why does my avatar change back to normal here’s a video!

robloxapp-20241026-1211218.wmv (2.9 MB)

As you see when I respawn it changes my avatar back to normal instead of my custom one

ALSO IDK WHY YOU HAVE TO DOWNLOAD A VIDEO

You are changing the character via an event, you did not put your model inside StarterPlayer with name StarterCharacter

Only problem is thats the point when you click the teams it should change the character not automatically change it

I’m on phone, but perhaps you’re using player:LoadCharacter somewhere? This would set your character to your default roblox character.

When CharacterAdded event fires, set the player character to the character you want.

Wait heres the scripts

--client
local RS = game:GetService("ReplicatedStorage")

local T = RS:WaitForChild("Test")

script.Parent.MouseButton1Up:Connect(function()
	T:FireServer()
end)

--Server
local RS = game:GetService("ReplicatedStorage")

local T = RS:WaitForChild("Test")

T.OnServerEvent:Connect(function(Player)
	
	local NewAnimate = Player.Character.Animate:Clone()
	
	local NewClone = RS:WaitForChild("Civilan"):Clone()
	NewClone.Name = Player.Name
	Player.Character = NewClone
	
	NewClone.HumanoidRootPart.CFrame = game.Workspace:WaitForChild("SpawnLocation").CFrame + Vector3.new(0,3,0)
	
	NewClone.Parent = game.Workspace
	
end)

you can do smth like this:

--client
local RS = game:GetService("ReplicatedStorage")

local T = RS:WaitForChild("Test")

script.Parent.MouseButton1Up:Connect(function()
	T:FireServer()
end)

--Server
local RS = game:GetService("ReplicatedStorage")

local T = RS:WaitForChild("Test")
local function SetChar(Player)
	local NewAnimate = Player.Character.Animate:Clone()

	local NewClone = RS:WaitForChild("Civilan"):Clone()
	NewClone.Name = Player.Name
	Player.Character = NewClone

	NewClone.HumanoidRootPart.CFrame = game.Workspace:WaitForChild("SpawnLocation").CFrame + Vector3.new(0,3,0)

	NewClone.Parent = game.Workspace
end

T.OnServerEvent:Connect(function(Player)
	SetChar(Player)
	
	Player.CharacterAdded:Connect(function(char)
		SetChar(Player)
	end)
end)

Thanks this works but the only thing is I get these errors

13:04:41.590 Maximum event re-entrancy depth (80) exceeded for Instance.ChildRemoved - Studio
13:04:41.590 Maximum event re-entrancy depth (80) exceeded for Instance.ChildAdded - Studio
13:04:41.590 Maximum event re-entrancy depth (80) exceeded for Player.CharacterAdded - Studio

1 Like

And it spamed these erros like 150 times (This is from a different script by the way)

13:04:41.782 Players.arifgamer332.PlayerGui.MainMenu.MainMenu.Fade.FadeIn/OutScript:1: attempt to index nil with ‘Parent’ - Studio

13:04:41.782 Players.arifgamer332.PlayerGui.MainMenu.MainMenu.Back.Teams.LocalScript:5: attempt to index nil with ‘MouseButton1Up’ - Studio

These seem like an errors from the studio not from the scripts

Oh but will they lag the game out if there are so many errors?

And it only happens when I oof

Yes, it will, i also noticed a spelling mistake in my code player should be Player, i have edited my reply.

use CharacterAppearanceLoaded instead so the script can override the default avatar

Wait where do i put that? in what part

if you want to use that, edit this part:

to this:

Player.CharacterAppearanceLoaded:Connect(function(char)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.