CharacterAdded not working on mobile

This script is on the server and clones a nametag to the player
It works fine on computer but it doesn’t work on mobile

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local c = script.NameTag:Clone()
		c.Parent = character.Head
	end)
end)

you don’t really need to do this, Just create a Server Script for StarterCharacterScripts and do this:

local character = script.Parent
local c = game.ReplicatedStorage.NameTag:Clone()
		c.Parent = character.Head

Although this doesn’t really answer your question (it might fix the issue, no guarantee) should still be useful

2 Likes

I tried that, still works for pc, no luck on mobile

Use GetService on both server and client (best practices),
and WaitForChild on the client.

maybe try WaitForChild might be that pc loads faster than mobile, not sure though

Try this instead:

local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		repeat task.wait() until character.Parent ~= nil
		local c = script.NameTag:Clone()
		c.Parent = character.Head
	end)
end)

Note: The CharacterAdded event doesn’t mean that its descendants are loaded and registered…

1 Like

You’re directly referencing NameTag, which may not be loaded yet. Try using :WaitForChild('NameTag') instead. The same goes for character.Head.

The entire body doesn’t load when the head does. Try using character:WaitForChild("Head)" instead.

It’s not that character added isn’t working it’s that roblox has a bug where if you’re not using the default head it won’t work.
Instead try:
game.workspace:WaitForChild(player.Name).Head

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