so, offline everyhting is working, when i play the game the plaer spawns with all guis, when i reset the player, the player respawns with everything like it's scripted to do. but online when the player respawns i se the guis for a sec and then they disappear, i guess they are being destroyed. this seems like something new to me, because i'm pretty sure it was all working before. the script i'm using to load the guis is like this
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) while not player.Character do wait() end local g = game.ServerStorage.gui:Clone() g.Parent = player.PlayerGui end) end)
is there ANY reason why g wouldn't be cloned into playergui after they reset or die?
It needs to be in the starter gui or you need to clone it in every time. I would like it if roblox added in a gui backpack like the normal backpack but they havent. :)
Put g in game.StarterGui, when a player dies it resets into startergui. Just adding it to playegui wont make it permenment
There is a property of PlayerGui called ResetPlayerGuiOnSpawn that holds a bool value telling the game whether you want PlayerGui's descendants to be removed or not. It defaults to true but if you set this to false all of the gui's inside of PlayerGui will not be altered.
If you only want a couple of GUIs to not be deleted, you have the option of either letting them all delete and cloning the ones you want back into PlayerGui or setting ResetPlayerGuiOnSpawn to false and using either the Died or CharacterAdded event to remove the unwanted GUIs.
In terms of your script, the Error might be coming from you variable 'g' itself. You forgot to put the '()' on the end of Clone.
local g = game.ServerStorage.gui:Clone()
how to fix this is create a folder named starter store that in lighting or storage create a for loop that loops the children of starter and moves them to player gui in starter player
Locked by MessorAdmin, User#5978, and chess123mate
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?