Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Local Script Not Running?

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

✓ Accepted answer

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

2 comments

0

Thank you! i also realised that the value on line 2 and 3 didnt match :P gamestart and Intstart.

0

Ah, that'd be a problem as well. Glad I could help :P

This discussion is preserved as it was. New answers, comments, and votes are closed.