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

Why does my GUI stop popping up after I set ResetOnSpawn to false?

I have code in a script that sets PlayerGUI ResetOnSpawn to false. This script is directly under StarterGUI This is necessary for other functions in my program

As seen:

game:GetService("StarterGui").ResetPlayerGuiOnSpawn = false

However, after I noticed that this caused my other local script to stop working completely, even though it worked fine before. The purpose of this script is to make the Frame visible when a tool is equipped. This local script is under a Frame which is under a screen GUI.

This is the non-working local script:

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local Character = player.Character 
Character.ChildAdded:Connect(function(NewChild)
   if NewChild:IsA("Tool") then
		script.Parent.Visible = true
		
   end
end)

Character.ChildRemoved:Connect(function(RemovedChild)
   if RemovedChild:IsA("Tool") then
		script.Parent.Visible = false
   end
end)

Does anyone know why this is happening and how I could prevent it?

1 answer

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