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

Why won't the color of the text change?

Asked by 5 years ago

This may be a bit confusing but I won't the colour of the nametags text to change?

One of my change colour scripts:

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Parent.NameColor.Value = "'Deep Orange'"
    script.Parent.ImageTransparency = 0
    script.Parent.Parent.BlueNameColor.ImageTransparency = 0.7
    script.Parent.Parent.GreenNameColor.ImageTransparency = 0.6
    script.Parent.Parent.RedNameColor.ImageTransparency = 0.7
end)

My Confirm button:

local RepStorage = game:GetService("ReplicatedStorage")
local Remote = RepStorage:WaitForChild("NametagCreatingEvent")

script.Parent.MouseButton1Click:Connect(function()
    if script.Parent.Parent.NameColor ~= "Nothing" and script.Parent.Parent.EnterNameBox.Text ~= "Enter name here" then 
        --Varibles--
        local PlayerName = game.Players.LocalPlayer.Name
        local NameChoice = script.Parent.Parent.EnterNameBox.Text
        local ColorChoice = script.Parent.Parent.NameColor.Value
        --RemoteEvents--
        Remote:FireServer(NameChoice, ColorChoice)
    end
end)

My Nametag creator script:

local RepStorage = game:GetService("ReplicatedStorage")
local Remote = RepStorage:WaitForChild("NametagCreatingEvent")

Remote.OnServerEvent:Connect(function(player, NameChoice, ColorChoice)
    --Varibles--
    local PlayerName = player.Name
    local Nametag = game.ReplicatedStorage.CloneableObjects.Nametag:Clone()
    wait(0.1)
--Setting values--
    Nametag.Parent = game.Workspace[PlayerName].Head
    Nametag.NameLabel.Text = NameChoice
    Nametag.NameLabel.TextColor = BrickColor.new(ColorChoice)
end)

I kinda wan't a system like the game survivior.

0
you can not edit the player's gui from the server, try bouncing back the remote event w/ FireClient theking48989987 2147 — 5y
0
But i can change the labels text? retrobricks 162 — 5y

1 answer

Log in to vote
2
Answered by
popeeyy 493 Moderation Voter
5 years ago

There are multiple reasons for your text not changing colors.

First of all, 'Deep Orange' is not a color. It is 'Deep orange', capitalization matters. To get the correct capitalization, I suggest making a brick that has the color. I also suggest using Color3, but using Color works too.

Also, you said the brick color is 'Deep Orange', when it is Deep orange. You already put it in a string so there's no need for ' '

Also, make sure the first 2 scripts are LOCAL scripts.

Here's what it should look like in the end:

Change colour scripts:

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Parent.NameColor.Value = "Deep orange"
    script.Parent.ImageTransparency = 0
    script.Parent.Parent.BlueNameColor.ImageTransparency = 0.7
    script.Parent.Parent.GreenNameColor.ImageTransparency = 0.6
    script.Parent.Parent.RedNameColor.ImageTransparency = 0.7
end)
0
Still no work ;( retrobricks 162 — 5y
0
nvm in works THANKS retrobricks 162 — 5y
Ad

Answer this question