UIStroke color difficulties

I’m trying to make a system where if a map has a certain difficulty, the UIStroke of the text changes, but it just doesn’t work and I don’t know how to fix it.

Error:

Players.InkBrains.PlayerGui.Vote.MapVoteGui.VotingClient:29: attempt to index nil with 'Color'  -  Client - VotingClient:29

Code:

	newMapFrame.MapDifficulty.Text = map.Configuration.Difficulty.Value
		if map.Configuration.Difficulty.Value == "Easy" then
			newMapFrame.MapDifficulty.Text.UIStroke.Color = Color3.fromRGB(81, 255, 0)
		elseif map.map.Configuration.Difficulty.Value == "Normal" then
			newMapFrame.MapDifficulty.Text.UIStroke.Color = Color3.fromRGB(255, 157, 0)
		elseif map.Configuration.Difficulty.Value == "Hard" then
			newMapFrame.MapDifficulty.Text.UIStroke.Color = Color3.fromRGB(255, 0, 0)
		end
2 Likes

The error message indicates that one of the TextLabels is missing a UIStroke. Have you confirmed that all TextLabels have a UIStroke?

3 Likes

While looking at this I found the issue, for some reason I put “.text” after referencing the text label instead of the UIStroke. Thank you for your help!

2 Likes

Great! I would like to bring to your attention on another issue on this line:

elseif map.map.Configuration.Difficulty.Value == "Normal" then

Should be map.Configuration instead of map.map.Configuration.

2 Likes

Yeah I also figured that out pretty quick after testing this lol. I have no idea what I was thinking when i wrote this.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.