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

Why wont screen GUI appear when enabled in game?

Asked by 5 years ago
Edited 5 years ago

So, I have this screen GUI. It doesn't appear when enabled in game, unless it starts out enabled. Pls help.

permission = {"Greatnate09"}

function checkOkToLetIn(name)

for i = 1,#permission do

if (string.upper(name) == string.upper(permission[i])) then return true end

end

return false

end

local Door = script.Parent

function onTouched(hit)

local human = hit.Parent:findFirstChild("Humanoid")

if (human ~= nil ) then

if (checkOkToLetIn(human.Parent.Name)) then

game.StarterGui.ScreenGui.Enabled = true

game.ServerScriptService.Script.Disabled = true

game.Workspace.Music.Sound1:Stop()

game.Workspace.Music.Sound2:Stop()

game.Workspace.Music.Sound3:Stop()

game.Workspace.Music.Sound4:Stop()

game.Workspace.Sound:Play()

game.Workspace.MusicOn.Script.Disabled = true

game.Workspace.MusicOff.Script.Disabled = true

wait(300)

game.StarterGui.ScreenGui.Enabled = false

game.Workspace.Sound:Stop()

game.Workspace.MusicOn.Script.Disabled = false

game.Workspace.MusicOff.Script.Disabled = false

end

end

end

script.Parent.Touched:connect(onTouched)

0
May we see the script that makes it enabled in game? Protogen_Dev 268 — 5y
0
there TheExtraDip 19 — 5y
0
this site is useless TheExtraDip 19 — 5y

2 answers

Log in to vote
1
Answered by 5 years ago

All you really need to do is keep it enabled but instead the main frame inside the gui turn the value visible off. Then using the script turn the value visible on again. Also you have to change the gui inside of the players gui not the starter gui. Get to the players "PlayerGui" using

local Plr = game.Players:GetPlayerFromCharacter(human.Parent) local gui = Plr:WaitForChild("PlayerGui")

Good luck

Ad
Log in to vote
0
Answered by 5 years ago

I fixed it. All i had to do is put a local script in starter gui reading a string value in replicated storage which i edited in my script above.

Answer this question