I have a script in a block in workspace that turns on w/ a clickdetector. Ideally I need it to change the transparency of a ScreenGui in StarterGui to 1 when clicked, but I don't know if there's any way to connect the two.
This is the script in the clickdetector, but I just don't know how to connect it with StarterGui. If anyone could help I'd really appreciate it. :)
local isOn = true StarterGui = StarterGui.ScreenGui.Frame.ImageLabel.ImageTransparency function on() isOn = true script.StarterGui = 0.8 end function off() isOn = false script.StarterGui = 1 end function onClicked() if isOn == true then off() else on() end end script.Parent.ClickDetector.MouseClick:connect(onClicked) on()
What the client see on their screen are descendants of their PlayerGui. StarterGui just allows the developer to replicate GuiInstances or client-sided scripts to a client's PlayerGui.
You can access 'PlayerGui' in a client-sided script by:
local playerGui = game.Players.LocalPlayer.PlayerGui