local Textlabel = script.Parent local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats") local ColoursFolder = game.Players.LocalPlayer:WaitForChild("Colours") local Green = ColoursFolder:WaitForChild("Green") local White = ColoursFolder:WaitForChild("White") local Purple = ColoursFolder:WaitForChild("Purple") local Blue = ColoursFolder:WaitForChild("Blue") local Yellow = ColoursFolder:WaitForChild("White") local RandomNumber = math.random(1,5) local RandomNumber1 = math.random(1,2) local RandomNumber2 = math.random(1,3) local RandomNumber3 = math.random(1,5) local RandomNumber4 = math.random(1,5) local NpcPart = game.Workspace.NpcTestPart
NpcPart.Touched:Connect(function() if RandomNumber == 1 then if White.Value == true then Textlabel.Text = "White" end end if RandomNumber == 2 then if Yellow.Value == true then Textlabel.Text = "Yellow" else Textlabel.Text = 'White' end end if RandomNumber == 3 then if Blue.Value == true then Textlabel.Text = 'Blue' elseif RandomNumber1 == 1 then Textlabel.Text = 'white' end elseif RandomNumber1 == 2 then if Yellow.Value == true then Textlabel.Text = 'Yellow' else Textlabel.Text = 'White' end end
In this script im trying to check if the player has a color and run a random.math to select a random color and choose another color if the plalyer hasn't got the color
now this code doens't give me an error it just does nothing