When I clicked the credits button to make the credits gui appear it doesn’t
Script:
local Button = script.Parent
local CreditsGui = game.StarterGui.CreditsGui
Button.MouseButton1Click:Connect(function()
CreditsGui.Enabled = true
end)
Video:
When I clicked the credits button to make the credits gui appear it doesn’t
Script:
local Button = script.Parent
local CreditsGui = game.StarterGui.CreditsGui
Button.MouseButton1Click:Connect(function()
CreditsGui.Enabled = true
end)
Video:
The issue lies with how your CreditsGui variable is declared. You’re accessing the GUI inside of the StarterGui folder and not the one inside of the players PlayerGui folder. When a player joins the game all of the GUIs inside the StarterGui folder are copied to the PlayerGui folder. If your script is a LocalScript you can get the correct GUI like this:
local CreditsGui = game.Players.LocalPlayer.PlayerGui.CreditsGui
It worked thank you so much!
(30 words)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.