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

Is this Text label color changing script when Gui button is clicked correct?

Asked by 3 years ago
Edited 3 years ago
script.Parent.TextButton.MouseButton1Click:Connect(function()
    game.ReplicatedStorage.NameTag.UpperText.TextColor3 = Color3.fromRGB(125, 255, 105)
    print("Worked")
end)

please help me if there is something wrong in my script. Let me know if I need to give you anymore info

0
could you use a code block valk_3D 140 — 3y
0
Im very new to scripting, What does codeblock do and how?. Im very sorry TeaWithMee 76 — 3y
0
~~~~~~~~~~~~~~~~~ code goes here ~~~~~~~~~~~~~~~~~ valk_3D 140 — 3y
0
ok TeaWithMee 76 — 3y
View all comments (4 more)
0
are you cloning the nametag? valk_3D 140 — 3y
0
No, can you give me an example TeaWithMee 76 — 3y
0
it depends on what you are trying to make, Are you trying to make a nametag for a player? valk_3D 140 — 3y
0
Yes, Im supposed to make the color change from a nametag that exists there TeaWithMee 76 — 3y

1 answer

Log in to vote
0
Answered by
valk_3D 140
3 years ago

create a BillBoard Gui then put it into replicated storage then create a text label and put it into the billboard and customize it

local BillboardGui = game.ReplicatedStorage.BillboardGui
local TextLabel = BillboardGui.TextLabel

script.Parent.MouseButton1Click:Connect(function()
    local Name = game.Players.LocalPlayer.Name
    local PlayerCharacter = workspace:FindFirstChild(Name)

    BillboardGui.Parent = PlayerCharacter.Head
    BillboardGui.Adornee = PlayerCharacter.Head
    BillboardGui.StudsOffset = Vector3.new(0,3,0)
    BillboardGui.MaxDistance = 45
end)

sorry for the wait

0
No problem thank you so much ill try it out TeaWithMee 76 — 3y
0
I have the billboard gui up with the text but when i run the script i always get "attempt to index nil with 'Name'" back in the errors TeaWithMee 76 — 3y
0
are you using a local script? valk_3D 140 — 3y
0
Even with a local it doesn't post an error, It runs the script but nothing happens TeaWithMee 76 — 3y
0
(Afk) Will respond soon if anything happens TeaWithMee 76 — 3y
Ad

Answer this question