I am getting an error that says ‘ClickPart is not a valid member of Model “Workspace.CheckComputer”’
I put this model in workspace and I am continuing to get this error.
I have tested this in different games/places I have but it is only giveing me this error in this game. I made no changes when moving it over to the other game and just copied it over directly.
This is a local script inside of screengui in startergui. When you click the screen on the model, the gui is supposed to show up but I am getting this error insted.
Ensure that if you’re running code from a LocalScript, Use :WaitForChild() so we ensure that we await until the specified Instance actually exists before listening to the MouseClick event.
Where would I put :WaitForChild() on this line game.Workspace.CheckComputer.ClickPart.ClickDetector.MouseClick:Connect(function()?
Or would I have to wait for the child first then do a separate one for the MouseClick?
Insert a script into your ClickDetector and paste this:
script.Parent.MouseClick:Connect(function(plr)
local plrGui = plr.PlayerGui
local mainGui = plrGui:WaitForChild("YourGUI")
local frame = mainGui:WaitForChild("YourFrame")
local frame2 = mainGui:WaitForChild("YourFrame")
-- You can add more variable if you want
frame.Visible = true
frame2.Visible = true
end)