Whats wrong with my script?
local TreeNotePart = game.Workspace.Game.TreeNote
local TreeNoteGui = game.StarterGui.TreeNoteGui
TreeNotePart.ClickDetector.MouseClick:Connect(function()
TreeNoteGui.Enabled = true
end)
All help appreciated!
Whats wrong with my script?
local TreeNotePart = game.Workspace.Game.TreeNote
local TreeNoteGui = game.StarterGui.TreeNoteGui
TreeNotePart.ClickDetector.MouseClick:Connect(function()
TreeNoteGui.Enabled = true
end)
All help appreciated!
So when I click a part, a gui appears
The problem is is that you are referencing the starter gui, not the player’s gui.
This should fix the problem:
local TreeNotePart = game.Workspace.Game.TreeNote
TreeNotePart.ClickDetector.MouseClick:Connect(function(plr)
plr.PlayerGui.TreeNoteGui.Enabled = true
end)
Thats because there is no part in workspace.Game called TreeNote, or the script loaded before TreeNote can load, so if thats whats happening then add this to the first line:
repeat wait(0.1) until workspace.Game:FindFirstChild("TreeNote")
I found it! Change plr.PlayerGui to plr.StarterGui
But there isnt a child of a player called StarterGui.
Whats probably happening is the script loads before the TreeNote can load.
You were right it didn’t load!