Happy Near Years Eve everyone. Anyway, so this value (with the script in it) is placed into your character from a different script (That works). The script that is not working is supposed to change the value of the StringValue to something specific, which depends on which team you are on. However, the script doesn't work. I have no idea why, and Output gave me nothing. Can someone please help me? Here's the script:
local check = game.Players:getPlayerFromCharacter(script.Parent.Parent)
repeat
wait()
until check:findFirstChild("TeamColor")
while true do
if check.TeamColor == ("Bright violet") then
wait(0.1)
script.Parent.Value = "AL"
elseif check.TeamColor == ("Bright yellow") then
wait(0.1)
script.Parent.Value = "Brazil"
elseif check.TeamColor == ("Bright blue") then
wait(0.1)
script.Parent.Value = "China"
elseif check.TeamColor == ("White") then
wait(0.1)
script.Parent.Value = "EU"
elseif check.TeamColor == ("Bright orange") then
wait(0.1)
script.Parent.Value = "India"
elseif check.TeamColor == ("Brown") then
wait(0.1)
script.Parent.Value = "NorthKorea"
elseif check.TeamColor == ("Bright red") then
wait(0.1)
script.Parent.Value = "Russia"
elseif check.TeamColor == ("Bright green") then
wait(0.1)
script.Parent.Value = "US"
end
end

3 comments
It still won't work, except Output actually gave me something this time. Output gave me this: "Players.Player.PlayerGui.Insert.Allegiance.Checker:5: attempt to index local 'check' (a nil value)"
It could possibly be that you said "check = game.Players:getPlayerFromCharacter" when the 'g' in "getPlayerFromCharacter" should be capitalized...so like this: check = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
If that doesn't work, give me some more information - Is this in a local script? Whose player from character are you trying to get?