Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with a script?

Asked by
Prioxis 673 Moderation Voter
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

So I made a script that will make a billboardgui above the characters head showing their name but I want it to where the default name doesn't show up "roblox coregui" how would I edit that?

heres my script

local plr = game.Players.LocalPlayer
repeat wait() until plr and plr.Character

local char = plr.Character
local head = char:WaitForChild("Head")
local sg = Instance.new("BillboardGui", char)
sg.StudsOffset = Vector3.new(0,1.5,0)
sg.Size = UDim2.new(1,0,1,0)
sg.Adornee = head

local txt = Instance.new("TextLabel", sg)
txt.BackgroundTransparency = 1
txt.TextColor = BrickColor.random()
txt.Font = "ArialBold"
txt.FontSize = "Size18"
txt.Text = plr.Name -- player name
txt.Size = UDim2.new(1,0,1,0)
char.Name = ""




2 answers

Log in to vote
1
Answered by
Bebee2 195
10 years ago

When a character is added, set the NameOcclusion property of the new humanoid to "OccludeAll"

Ex.

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(c)
c:WaitForChild'Humanoid'.NameOcclusion = "OccludeAll"
end)
end)
Ad
Log in to vote
-1
Answered by 10 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(c)
c:WaitForChild'Humanoid'.NameOcclusion = "OccludeAll"
end)
end)

local plr = game.Players.LocalPlayer
repeat wait() until plr and plr.Character

local char = plr.Character
local head = char:WaitForChild("Head")
local sg = Instance.new("BillboardGui", char)
sg.StudsOffset = Vector3.new(0,1.5,0)
sg.Size = UDim2.new(1,0,1,0)
sg.Adornee = head

local txt = Instance.new("TextLabel", sg)
txt.BackgroundTransparency = 1
txt.TextColor = BrickColor.random()
txt.Font = "ArialBold"
txt.FontSize = "Size18"
txt.Text = plr.Name -- player name
txt.Size = UDim2.new(1,0,1,0)
char.Name = ""


--- The comment above or below me (lol) is right add the occlusion.
---GoodkidMad

Should work now.

Answer this question