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?
