Hi all
i was making a script in which when a note is clicked it will appear on the left side of the player’s screen but for some reason that’s not happening
the script
local Clickf = game.Workspace.Notef.ClickDetector
local Clickh = game.Workspace.Noteh.ClickDetector
local Clickc = game.Workspace.Notec.ClickDetector
local Clickb = game.Workspace.Noteb.ClickDetector
Clickf.MouseClick:Connect(function()
script.Parent.Fa.Visible = true
end)
Clickh.MouseClick:Connect(function()
script.Parent.Ha.Visible = true
end)
Clickc.MouseClick:Connect(function()
script.Parent.Ca.Visible = true
end)
Clickb.MouseClick:Connect(function()
script.Parent.Ba.Visible = true
end)
if game.Workspace.Safe.Door.CFrame == game.Workspace.Safe.Door2.CFrame then
script.Parent.Enabled = false
end
i dont know if the problem is with the naming or something else
Try accessing the players GUI to do this function.
Try this;
local Clickf = game.Workspace.Notef.ClickDetector
local Clickh = game.Workspace.Noteh.ClickDetector
local Clickc = game.Workspace.Notec.ClickDetector
local Clickb = game.Workspace.Noteb.ClickDetector
Clickf.MouseClick:Connect(function(plr)
plr:WaitForChild("PlayerGui"):WaitForChild("etc etc.").Visible = true -- set your directory
end)
Clickh.MouseClick:Connect(function(plr)
plr:WaitForChild("PlayerGui"):WaitForChild("etc etc.").Visible = true -- set your directory
end)
Clickc.MouseClick:Connect(function(plr)
plr:WaitForChild("PlayerGui"):WaitForChild("etc etc.").Visible = true -- set your directory
end)
Clickb.MouseClick:Connect(function(plr)
plr:WaitForChild("PlayerGui"):WaitForChild("etc etc.").Visible = true -- set your directory
end)
if game.Workspace.Safe.Door.CFrame == game.Workspace.Safe.Door2.CFrame then
script.Parent.Enabled = false
end