✓ Accepted answer
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!
6 comments
Makes the shop button disappear and the button color and textstroke color stays white.
Oh sorry! I have forgotten something, let me edit my answer
No worries.
Okay, I have edited the answer, hopefully that will work!
Had to change a few things but it all worked out in the end, thank you!
No problem!