its a localscript also its in starterplayerscripts
local GUI = UI local Button = GUI.Button local player = game.Workspace.localPlayer local repStorage = game:GetService("ReplicatedStorage") local remote = repStorage:FindFirstChild("ButtonClick") mouse = player:GetMouse() local idoit = game.Workspace.CHING.ClickDetector UI = game.StarterGui.KiKidied.tooxtbutton --idk why i named it that no judge idoit.MouseButton1Click:Connect(function() local frame = GUI.Frame Button.MouseButton1Click:Connect(function() frame.Visible = true end) end)
If you want a Frame to be visible when you click on a ClickDetector, all you have to fix is
idoit.MouseButton1Click:Connect(function() local frame = GUI.Frame frame.Visible = true -- The frame becomes visible when 'idoit' (the ClickDetector) is clicked. end)
Also, you should probably use the WaitForChild() function when you're getting something from the StarterGui, or other places. It'll wait until the thing you want exists.
idoit.MouseButton1Click:Connect(function() local frame = GUI.Frame frame.Visible = true -- The frame becomes visible when 'idoit' (the ClickDetector) is clicked. end)
local GUI = game.StarterGui:WaitForChild("KiKidied"):WaitForChild("tooxtbutton") -- this will throw a warning if there is no such object as 'KiKidied' in StarterGui, or if there is no such object as 'tooxtbutton' in KiKidied. local Button = GUI.Button local player = game.Workspace.LocalPlayer local repStorage = game:GetService("ReplicatedStorage") local remote = repStorage:FindFirstChild("ButtonClick") mouse = player:GetMouse() local idoit = game.Workspace.CHING.ClickDetector
You shouldn't really put two WaitForChild() functions in in a row, but to not modify your script too much, I made the script wait until there is an object named 'KiKidied' in StarterGui. Then it'll wait until there is an object named 'tooxtbutton' in 'KiKidied'.
I hope this helped, I was a bit sleepy when I wrote this, you're free to ask any questions.
You can use a RemoteEvent for that, which you can find here: https://www.robloxdev.com/api-reference/class/RemoteEvent