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

(solved, thank you!) how can i make a gui be disabled on the client-side?

Asked by 4 years ago
Edited 4 years ago

so i made an intro gui, but i'm having a problem where if you respawn in any way, the gui will show up and you have to go through an intro sequence again.

i only want to disable the gui locally because if i disable it on the server, i'm pretty sure that nobody will be able to get it again.

i've tried a few methods i thought would work, but none of them did

if possible that you could help me with samples of a part touch trigger, so like if a player touches a part (like for example an invisible border near the spawn) it disables the gui for that player and that player only, thank you!

picture of the gui location in StarterGui (its StartGui)

https://imgur.com/7dMZDQE

thanks in advance!

0
Are you using the PlayerGui? ParticularlyPenguin 71 — 4y

2 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

There is a property called ResetOnspawn, turn that off and the gui won't reset (like the chat), hope that helped! (A way to disable the GUI(local script inside GUI):

local a = script.Parent -- IntroGUI
wait(10) -- After the gui disappear after loading(change it if needed)
a:.Enabled = false

)

Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Put this script in a local script within StarterGui (parent doesn't matter).

local Player = game.Players.LocalPlayer
local playerGui = Player:WaitForChild("PlayerGui")

playerGui.StartGui.Enabled = true

You have to use PlayerGui as those are the Guis that the player sees.

0
Script should only work when a player joins, not when they respawn. ParticularlyPenguin 71 — 4y

Answer this question