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

Individual Player StarterGuis?

I would like to know if it is possible to create GUIs that don't reset upon death. I want only certain GUIs to stay while the others are deleted. I can't provide a script because I don't even know if this is possible and I don't know where to start. However, I do know how to disable GUI resets:

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

The problem with this is that it disables ALL GUI resets. If you can answer this, it'd be great. Thanks in advance!

1 answer

A way to get around this is by parenting the gui into ServerStorage when the client dies, then when they load again clone the gui back into their PlayerGui.

Example;

local gui = game.ServerStorage.GuiToClone

game.Players.PlayerAdded:connect(function(plr)
	local newGui = gui:Clone()
	newGui.Name = plr.Name.."'s Gui"
	newGui.Parent = plr.PlayerGui
	plr.CharacterAdded:connect(function(char)
		local presentGui = plr.PlayerGui:FindFirstChild(plr.Name.."'s Gui)
		if not presentGui then
			local gui = game.ServerStorage:FindFirstChild(plr.Name.."'s Gui)
			if gui then
				gui.Parent = plr.PlayerGui
			end
		end
		char.Humanoid.Died:connect(function()
			plr.PlayerGui:FindFirstChild(plr.Name.."'s Gui").Parent = game.ServerStorage
		end)
	end)
end)

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