Answered by
4 years ago Edited 4 years ago
Hello.
The reason as to why your script isn't working is because you are using Color3.new instead of Color3.fromRGB. Color3.fromRGB is used for GUIS, as for Color3.new is used for other things, also you have defined the wrong Shop. you have defined the Shop frame instead of the Shop button. Because the Shop frame isn't a TextButton
, it doesn't have the functions of a TextButton
, which in your case, are TextColor3
and TextStrokeColor3
. I suggest defining the items instead of using Parent climbs, just to make sure that what you are defining is correct, and it's also tidier! I have fixed the script for you, tested it and everything worked like it should've.
01 | local Player = game:GetService( "Players" ).LocalPlayer |
02 | local PlayerGui = Player:WaitForChild( "PlayerGui" ) |
03 | local GUI = PlayerGui.Main |
04 | local Button = script.Parent |
05 | local Shop = script.Parent.Parent.Shop |
06 | local ChangeTeam = GUI.Frame.ChangeTeam |
07 | local Credits = script.Parent.Parent.Credits |
09 | Button.MouseButton 1 Click:Connect( function () |
11 | ChangeTeam.Visible = true |
12 | Button.TextColor 3 = Color 3. fromRGB( 255 , 52 , 52 ) |
13 | Button.TextStrokeColor 3 = Color 3. fromRGB( 255 , 52 , 52 ) |
14 | Shop.TextColor 3 = Color 3. fromRGB( 255 , 255 , 255 ) |
15 | Shop.TextStrokeColor 3 = Color 3. fromRGB( 255 , 255 , 255 ) |
16 | Credits.TextColor 3 = Color 3. fromRGB( 255 , 255 , 255 ) |
17 | Credits.TextStrokeColor 3 = Color 3. fromRGB( 255 , 255 , 255 ) |
Hope this has helped you, if so, feel free to accept my answer, or, if you have any questions, feel free to ask them in the comments below!