I think I should add something like function or something like that
local clickdetector = workspace.PassportDealer.ClickDetector local GUI = game.StarterGui.PassportGUI local tool = game.ServerStorage.Passport clickdetector.MouseClick:Connect(function() GUI.Enabled = true end) GUI.Frame.X.MouseButton1Click:Connect(function() GUI.Enabled = false end) GUI.Frame.ImageButton.MouseButton1Click:Connect(function() tool.Parent = game.StarterPack end)
Here is your problem:
local GUI = game.StarterGui.PassportGUI
You have to use the PlayerGui rather then the StarterGui:
local GUI = game.Players.LocalPlayer.PlayerGui.PassportGUI
First of all, you're editing StarterGui and not PlayerGui (StarterGui objects is being cloned inside a folder called PlayerGui that's inside the player)
Second, a localscript cannot access any serversided services, such as ServerScriptService and ServerStorage.
Third, you'd want to use :WaitForChild on the PassportDealer as it might not have been replicated to the client yet.
(I assume this is a localscript as you're doing UI-related things, such as editing a gui.)
Example:
local clickdetector = workspace.PassportDealer.ClickDetector -- Will error if clickdetector hasn't replicated local clickdetector = workspace:FindfirstChild("PassportDealer").ClickDetector -- Won't error, but clickdetector will be nil if the clickdetector hasn't replicated local clickdetector = workspace:WaitForChild("PassportDealer").ClickDetector -- Will wait until the clickdetector has replicated before continuing