Hello! I need help with this and I can’t understand what’s going on. I have an overhead GUI script that’s only working for other devices but mobile. There aren’t any errors. Here’s the photo on PC, and also on mobile. It won’t even show up over the mobile user when looking at them from the PC perspective. Can anyone explain? Thanks!
What I’ve also noticed: I joined on PC, then I joined on mobile, then my friend joined on PC. On all three screens, no one could see the overhead GUI on the mobile user, but it was visible on the PC users on all three screens. So I know for a fact it could be a mobile issue and I need to somehow make it mobile compatible?
Script under ServerScriptService (Nametag GUI under ServerStorage):
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local head = char.Head
local nametag = game.ServerStorage.Nametag:Clone()
local textlabel = nametag.Uppertext
local what = nametag.Lowertext
nametag.Parent = head
nametag.Adornee = head
textlabel.Text = plr.Name
what.Text = "Guest"
if plr:GetRankInGroup(15508119) == 255 then
what.Text = "Owner"
textlabel.TextColor3 = Color3.new(1, 0.0332952, 0)
what.TextColor3 = Color3.new(1, 0.0332952, 0)
end
end)
end)
There’s more to the script, but this is just the basics of it.
Something you could try would be to run the game in mobile and then bring up your explorer and properties. Open up your character in the workspace and click on the Nametag and see if it highlights. Maybe adjust some properties while the game is up and running and see if anything changes.
PlayerAdded only runs when a player joins the game. This means that if you join a game and other players are already in the game, the code in PlayerAdded won’t run. For this, you need to loop over all players that are already in the game.
Another point to mention is that sometimes, if you yield before PlayerAdded is connected to a function, it may not run for your Player, since you connected to it after you were already “added.”
Try this out:
function PlayerAdded(plr)
local function CharacterAdded(char)
local head = char.Head
local nametag = game.ServerStorage.Nametag:Clone()
local textlabel = nametag.Uppertext
local what = nametag.Lowertext
nametag.Parent = head
nametag.Adornee = head
textlabel.Text = plr.Name
what.Text = "Guest"
if plr:GetRankInGroup(15508119) == 255 then
what.Text = "Owner"
textlabel.TextColor3 = Color3.new(1, 0.0332952, 0)
what.TextColor3 = Color3.new(1, 0.0332952, 0)
end
end
plr.CharacterAdded:Connect(CharacterAdded)
if plr.Character then
CharacterAdded(plr.Character)
end
end
game.Players.PlayerAdded:Connect(PlayerAdded)
for _, Player in next, game.Players:GetPlayers() do
PlayerAdded(Player)
end
Hey, I tried this out and it still seems like it’s not working. It’s working on PC and both devices can see the GUI on the player on the PC device, but both devices cannot see the GUI on top of the player who’s on the mobile device.
How could I bring up explorer on mobile? I can’t access the game’s explorer tab while in game and can’t try it out in studio as mobile is not available on studio.
Oh that works. Still running tests and trying new things but it seems like it’s not the device problem, it’s the player’s problem. It’s only happening with this username. I don’t know why and I’m trying to run as many tests as I can to try and figure it out.
The two day mystery has been solved! Apparently the character was checked too fast before it actually loaded. Luckily I somehow found this out by luck and trying random things. What I did was to add a “repeat task.wait(0.01) until char”. This way it waits until the character has been actually loaded. Not sure why this is only happening to this account and also why I need to add that line of code as the code only happens when the character has been added. Oh well, it works now! Thanks for everyone’s reply.