Basically i want a gui to appear above the player, and when you join it works, but if the player reseted it doesnt work, specifically after cloning i’ve printed the parent of the clone and it says it’s nil.
local hasAccess = false
Access.OnClientEvent:Connect(function()
hasAccess = true
print("a")
for i, playerClientSided in pairs(Players:GetPlayers()) do
local charact = playerClientSided.Character
local bilbrdGui = script:WaitForChild("UserIdGUI"):Clone()
bilbrdGui.Parent = charact.PrimaryPart
bilbrdGui.TextLabel.Text = playerClientSided.UserId
playerClientSided.CharacterAdded:Connect(function(char)
print("ADDED")
local bilbordGui = script:WaitForChild("UserIdGUI"):Clone()
print(bilbordGui.Parent)
bilbordGui.Parent = char.PrimaryPart
print(bilbordGui.Parent)
bilbordGui.TextLabel.Text = playerClientSided.UserId
print("b")
end)
end
end)
(1. a, 2. Reseted, 3. Added, 4. nil…)
It works for the first time but second no which is weird