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
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
end)
local GUI = game.StarterGui:WaitForChild("KiKidied"):WaitForChild("tooxtbutton")
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.
2 comments
it tells me"infinite yield possible" and "localscript is not a valid member of players" also here is the scriptlocal 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.Frame --idk why i named it tha
Crap, I misspelled it. It's LocalPlayer, and if it gives you an 'infinite yield possible' error, it means that it doesn't have the object in the desired place.