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)
DasKairo
(Cairo)
December 2, 2022, 12:30am
#2
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
JubilantOfficial:
script.NameTag
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
system
(system)
Closed
December 17, 2022, 4:47pm
#11
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.