-- script local overheadGUI = game.ServerStorage.Overhead game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) local hum = char:WaitForChild("Humanoid") hum.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None hum.NameDisplayDistance = 0 hum.HealthDisplayDistance = 0 local head = char:WaitForChild("Head") local clone = overheadGUI:Clone() clone.Parent = head clone.Player.Text = player.Name clone.Level.Text = "Level "..player.Database.Level.Value hum.MaxHealth = player.Database.HP.Value clone.Frame.TextLabel.Text = math.floor(hum.Health).."/"..math.floor(hum.MaxHealth) hum:GetPropertyChangedSignal("Health"):Connect(function() local redZone = hum.MaxHealth / 4 if hum.Health <= redZone then clone.Frame.Bar.BackgroundColor3 = Color3.fromRGB(200, 0, 0) else clone.Frame.Bar.BackgroundColor3 = Color3.fromRGB(0, 209, 0) end clone.Frame.TextLabel.Text = math.floor(hum.Health).."/"..math.floor(hum.MaxHealth) clone.Frame.Bar.Size = UDim2.new((hum.Health/hum.MaxHealth), 0, 1, 0) end) end) end)
LocalScript:
local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() char:WaitForChild("Head").Overhead.Parent = game.ReplicatedStorage -- here's the error
I've tried everything I know, and when I reset my character, the overhead GUI appears for me as well, when normally it shouldn't appear for me, but for everybody else.
Change the error line to:
char:WaitForChild("Head").Overhead.Parent = game:GetService("ReplicatedStorage") -- it is because RS is a service so you need to do this
Add a LocalScript to the Overhead GUI containing just
script.Parent.Parent = game:GetService("ReplicatedStorage")
or wait for the Overhead GUI to be added to the Head using WaitForChild.
By the way, you don't have to wait for the Character in a StarterCharacterScript.