Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My gui wont enable when i try to open it with a local script?

Im trying to make where you can talk to npcs, im trying to figure out why this local script wont enable the Gui, i added prints too it said it worked, here is the script.

local clickDetector = game.Workspace.yuiigui.ClickDetector
local YuiiGui = game.StarterGui.Yuii
if game.StarterGui.Yuii.Enabled == false then
function onMouseClick()
		print("touched me")
		wait()
		YuiiGui.Enabled = true
		print("it worked")
		end

	clickDetector.MouseClick:connect(onMouseClick)
	end

it is located at StarterPlayerScripts, i have no idea why it wont enable it.

2 comments

1

StarterGui is a replication Container, it doesn't house the active user-interfaces, reference PlayerGui instead.

0

Thanks

1 answer

✓ Accepted answer

use PlayerGui, and also if you make the frame invisible again it won't appear. Fix: use a Script not LocalScript

This discussion is preserved as it was. New answers, comments, and votes are closed.