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

I need a script to make when the player dies/rests the ScreenGui Disappear ?

Asked by 4 years ago

i have turned off the rest on respawn command but its still not deleting the Gui when the player dies or rests. Plz help me ?

0
You could try making a script that makes the GUIs.Enabled = false when an certain event is fired. kevinsoaresv 47 — 4y
0
Hey you have to turn ResetOnSpawn to true and not to false TheRealPotatoChips 793 — 4y
0
And you don't need a script for that TheRealPotatoChips 793 — 4y

2 answers

Log in to vote
0
Answered by
NotedAPI 810 Moderation Voter
4 years ago

Hello, Ash_Gold!

You could use the Humanoid.Died function to tell when a player has died. When they do die you can go and disable the script.

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

local Character = workspace:WaitForChild(Player.Name)
local Humanoid = Character.Humanoid or Character:WaitForChild("Humanoid")

local ScreenGuiName = "ScreenGui"

Humanoid.Died:Connect(function()
    PlayerGui:WaitForChild(ScreenGuiName).Enabled = false
end)
0
@xWhiteHat what script is it a normal script or a localscript and where does the scipt go in e.g starterpack ,screengui Ash_Gold 2 — 4y
0
@Ash_Gold Sorry for the late reply. I made a LocalScript inside of StarterPlayerScripts and put that inside of it. NotedAPI 810 — 4y
0
Thank yea all for helping me with this command for my game if you would like i would send you a link to my new game when it is done Ash_Gold 2 — 4y
Ad
Log in to vote
0
Answered by
gloveshun 119
4 years ago

This is not a legal question

Answer this question