Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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.

1
StarterGui is a replication Container, it doesn't house the active user-interfaces, reference PlayerGui instead. Ziffixture 6913 — 3y
0
Thanks YuiiIsOld 13 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question