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

Local Script Not Running?

Asked by 9 years ago

Purpose: to make a script to edit the color of the frame, and the text of the gui its in, so its not working for some reason? and im not getting any errors. Code:

local player = game.Players.LocalPlayer
game.Workspace.Gamestart.Changed:connect(function()
if game.Workspace.Intstart.Value == true then
local Inttime = workspace.Intermission.Value
script.Parent.Plrname.Text = player.Name
script.Parent.inttime.Text = (Inttime.. "Until Round Starts")
script.Parent.BackgroundColor = player.TeamColor
else
script.Parent.BackgroundColor = BrickColor.White()
end
end)

Thanks for reading and please help me out if you can!

1 answer

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
9 years ago

The problem is that you're trying to use BrickColor Values, and Color3 Values together.

To fix this, we simply need to switch the BrickColor to a Color3, by adding .Color , so try using this script:

local player = game.Players.LocalPlayer
    game.Workspace.Gamestart.Changed:connect(function()
    if game.Workspace.Intstart.Value == true then
        local Inttime = workspace.Intermission.Value
        script.Parent.Plrname.Text = player.Name
        script.Parent.inttime.Text = (Inttime.. "Until Round Starts")
        script.Parent.BackgroundColor3 = player.TeamColor.Color --Also, it's BackgroundColor3, not just BackgroundColor
    else
        script.Parent.BackgroundColor3 = BrickColor.White().Color
    end
end)

Anyways, it should work now. If not, or if you have any further questions/problems, please leave a comment below. Hope I helped :P

0
Thank you! i also realised that the value on line 2 and 3 didnt match :P gamestart and Intstart. viralmoose 65 — 9y
0
Ah, that'd be a problem as well. Glad I could help :P dyler3 1510 — 9y
Ad

Answer this question