What do you want to achieve? Keep it simple and clear!
I want to make a GUI that shows on top of player’s head. And showing a role.
What is the issue? Include screenshots / videos if possible!
The script I made is supposed to add the GUI to the player’s head. But it’s infinite yielding to find the GUI, which is stored in Replicated Storage.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(character)
local UI = game.ReplicatedStorage:WaitForChild("Overhead"):Clone()
UI.Enabled = true
UI.Parent = character.Head
local Role = UI.Frame.Role
Role.Text = "Member"
end)
end)
I believe everything is great here but the script is infinite yielding to find the GUI.
Infinite yield possible on 'ReplicatedStorage:WaitForChild("Overhead")'
I left Studio without saving. I made it all again, the same code and everything. No longer yielding, but still cant see the GUI.
Have you tried seeing if the overhead has actually cloned and parented itself to the character? Try adding print statements between the lines of code to check if it’s running.