Help with script failing on and off

Hello, today I was making a script, the problem is that it doesn’t works, can someone help me ?

code:

local ewderw = game.Workspace.Tuyo

local camera = game.Workspace.Camera

local menucam = game.Workspace.MenuCamera

local playbotton = script.Parent.Basita

local rataya = script.Parent

local wholemenugui = game.StarterGui.Mainmenu.Cred

local ihaty = game.StarterGui.Mainmenu.NoobsThatMadeThisGameCred

trash = false

print(“1”)

repeat wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
print(“2”)

camera.CFrame = menucam.CFrame

playbotton.MouseButton1Click:Connect(function()
camera.CameraType = Enum.CameraType.Custom

rataya:Destroy()

end)

wholemenugui.MouseButton1Down:connect(function()

if trash == true then

	ihaty.Visible = true

	--true here
end
if trash == false then 

	ihaty.Visible = false
	--false here
end

end)

print(“3”)

— the part doesnt works is the " wholemenugui " part, the last one, idk why i doesn’t work, if you know why, please reply this message.

First off, I’d rewrite the last part using else, something like:

if trash == true then
    ihaty.Visible = true
    -- stuff to do when it is true
else
    ihaty.Visible = false
    -- stuff to do when it is false
end

Second, what exactly is happening here? I just wanna understand the problem a little better. Is there any error message or does anything change or does nothing happen at all?

Theres no " errors " in console, ill try your code now…

Doesn’t works, it doesn’t gives me any error in console

Does it print the “2” or “3” in the output?

yes it does, but it doesnt gives me any error.

Roblox pitfall #1 is that everything you find in special folders whose names start with “Starter” are items that serve as prototypes which are cloned at Runtime. You don’t ever want to make script references to things in these folders unless you’re manually cloning and parenting them (not something normally done in games, only in special kinds of test places).

Instead, you need to make all your connections to the clones that end up as descendants of the Player. For example, every player has a PlayerGui which is the live copy of what got cloned from StarterGui.