script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Parent.Shop.Visible = false script.Parent.Parent.Parent.ChangeTeam.Visible = true script.Parent.TextColor3 = Color3.new(255, 52, 52) script.Parent.TextStrokeColor3 = Color3.new(255, 52, 52) script.Parent.Parent.Shop.TextColor3 = Color3.new(255, 255, 255) script.Parent.Parent.Shop.TextStrokeColor3 = Color3.new(255, 255, 255) script.Parent.Parent.Credits.TextColor3 = Color3.new(255, 255, 255) script.Parent.Parent.Credits.TextStrokeColor3 = Color3.new(255, 255, 255) end)
No error codes shows
Explorer: https://prnt.sc/ty5zjq
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.
local Player = game:GetService("Players").LocalPlayer local PlayerGui = Player:WaitForChild("PlayerGui") local GUI = PlayerGui.Main local Button = script.Parent local Shop = script.Parent.Parent.Shop local ChangeTeam = GUI.Frame.ChangeTeam local Credits = script.Parent.Parent.Credits Button.MouseButton1Click:Connect(function() Shop.Visible = false ChangeTeam.Visible = true Button.TextColor3 = Color3.fromRGB(255, 52, 52) Button.TextStrokeColor3 = Color3.fromRGB(255, 52, 52) Shop.TextColor3 = Color3.fromRGB(255, 255, 255) Shop.TextStrokeColor3 = Color3.fromRGB(255, 255, 255) Credits.TextColor3 = Color3.fromRGB(255, 255, 255) Credits.TextStrokeColor3 = Color3.fromRGB(255, 255, 255) end)
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!