generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Re: How to stop GUI from resetting on respawn?

Previous Thread :: Next Thread 
Splashsky is not online. Splashsky
Joined: 30 Aug 2008
Total Posts: 1102
30 Dec 2014 07:22 AM
I used to use game.StarterGui.ResetPlayerGuiOnSpawn toggle to stop my GUI from "resetting" every time the player died. I have it in a LocalScript in StarterGui, but it doesn't seem to work like it did.

Basically, I don't want the GUI to "reset" or "reload" when the player dies. I want the GUI to persist.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Dec 2014 07:28 AM
It should work
Report Abuse
Kie413Games is not online. Kie413Games
Joined: 06 May 2010
Total Posts: 3896
30 Dec 2014 07:32 AM
StarterGuis gets reset on respawn.
Report Abuse
ComradeREKTangle is not online. ComradeREKTangle
Joined: 07 Feb 2010
Total Posts: 850
30 Dec 2014 07:36 AM
put it into the player's playergui
Report Abuse
Kie413Games is not online. Kie413Games
Joined: 06 May 2010
Total Posts: 3896
30 Dec 2014 07:38 AM
When a player dies, everything they have resets.
Including playerguis.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Dec 2014 07:40 AM
K you have no idea what you are talking about.
Report Abuse
Kie413Games is not online. Kie413Games
Joined: 06 May 2010
Total Posts: 3896
30 Dec 2014 07:42 AM
Well, if I read correctly.
He doesn't want the *Reset gui* to reload on respawn.
I doubt this is even possible.
Report Abuse
ComradeREKTangle is not online. ComradeREKTangle
Joined: 07 Feb 2010
Total Posts: 850
30 Dec 2014 07:42 AM
@kie, that isn't true, when you put stuff in StarterGear it doesn't reset
Report Abuse
Kie413Games is not online. Kie413Games
Joined: 06 May 2010
Total Posts: 3896
30 Dec 2014 07:43 AM
Yes it does, everything reloads ondeath.
Report Abuse
ComradeREKTangle is not online. ComradeREKTangle
Joined: 07 Feb 2010
Total Posts: 850
30 Dec 2014 07:43 AM
And it is possible


game.Players.PlayerAdded:connect(function(plr)
game.ServerStorage.[GUI]:clone().Parent = plr.PlayerGui
end)


Report Abuse
ComradeREKTangle is not online. ComradeREKTangle
Joined: 07 Feb 2010
Total Posts: 850
30 Dec 2014 07:44 AM
not everything, how about you actually try it?
Report Abuse
Kie413Games is not online. Kie413Games
Joined: 06 May 2010
Total Posts: 3896
30 Dec 2014 07:45 AM
No, he asked if he could prevent guis from loading everytime you die.
That script you just made would still have to run each time a player died.
Report Abuse
ComradeREKTangle is not online. ComradeREKTangle
Joined: 07 Feb 2010
Total Posts: 850
30 Dec 2014 07:49 AM
if he wants it stay:

game:GetService('Players').PlayerAdded:connect(function(plr)
--clone gui into plr.PlayerGui

plr.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
wait(8)
--clone gui into plr.PlayerGui

end)
end)
end)
Report Abuse
robloxking240 is not online. robloxking240
Joined: 19 Aug 2010
Total Posts: 7049
30 Dec 2014 07:53 AM
You can put the GUI somewhere else (such as ServerStorage or ReplicatedStorage) on death and have it be put back in PlayerGui after the player has respawned while deleting the GUI you get from StarterGui after the first death. Here's what I use (it's a regular script in ServerScriptService):
game.Players.PlayerAdded:connect(function(player)
local GUI = nil
local respawned = false
player.CharacterAdded:connect(function(character)
if respawned == true then
player.PlayerGui.ScreenGui:destroy()
GUI.Parent = player.PlayerGui
end
character.Humanoid.Died:connect(function()
if respawned == false then
GUI = player.PlayerGui.ScreenGui
respawned = true
GUI.Parent = game.ServerStorage
else
GUI.Parent = game.ServerStorage
end
end)
end)
end)

You should use a LocalScript somewhere outside of StarterGui instead if your game has filtering enabled, since regular scripts can't see GUIs if filtering is enabled.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
30 Dec 2014 08:19 AM
ResetPlayerGuiOnSpawn is correct. @Kie is incorrect.
Report Abuse
shadowspartain322 is not online. shadowspartain322
Joined: 12 Mar 2013
Total Posts: 3
09 Jul 2015 12:28 AM
Dont use resetonplayerrespawn whaterver its called clone it then parent it back in player gui works like a charm


shadowspartain322
Report Abuse
shadowspartain322 is not online. shadowspartain322
Joined: 12 Mar 2013
Total Posts: 3
09 Jul 2015 12:29 AM



shadowspartain322 even works with values 2 :P
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
09 Jul 2015 08:21 AM
Since this was bumped, here's a pretty cool script I just thought of. It basically replicated ResetPlayerGuiOnSpawn (since it doesn't seem to be working)

local gui = script.Gui
local clones = script.Clones

game.Players.PlayerAdded:connect(function(p)
local clone = gui:Clone()
local tag = Instance.new("StringValue", clone)
tag.Name = "Owner"
tag.Value = p.Name
p.CharacterAdded:connect(function(c)
clone.Parent = p.PlayerGui
end)
p.CharacterRemoving:connect(function(c)
clone.Parent = clones
end)
end)


Then have a hierarchy like this:


Script (This is the script I posted above
-Gui (This is the gui you're giving them
-Clones (This is where we store the clones while the character is not currently alive)
Report Abuse
Kevinllululala is online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
17 Sep 2015 09:46 AM
You don't need that much scripts to do the job, but you need common sense of script "name" changing!

Put the script in the workspace, and put the GUI under the script. Normal script, not local script.


game.Players.PlayerAdded:connect(function (newPlayer)
wait(0.01)
a = script.StartGui:Clone()
a.Parent = newPlayer.PlayerGui
end)




*Change the "StartGui" to your own gui object name*
Report Abuse
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
17 Sep 2015 10:13 AM
What about just cloning the GUI from Workspace into the player? Wouldn't that work?
Report Abuse
Kevinllululala is online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
18 Sep 2015 09:29 AM
@zero that is exactly what I did. Cloining it in workspace
Report Abuse
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
18 Sep 2015 10:15 AM
Ahhh didn't read your post. Phone is horrible when it comes to the forum.
Report Abuse
Kevinllululala is online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
07 Nov 2015 03:23 AM
And yes, my method works, because it is in my game. You can try going into my game, and reset, the gui won't pop up
Report Abuse
ScripterJohn13 is not online. ScripterJohn13
Joined: 01 Jan 2010
Total Posts: 5658
27 May 2016 06:11 PM
To those who are wondering about this I have figured it out. The Property doesn't replicate to the clients... You have to use the StarterPlayerScripts and manually set it

game.StarterGui.ResetPlayerGuiOnSpawn = false;
Report Abuse
ScripterJohn13 is not online. ScripterJohn13
Joined: 01 Jan 2010
Total Posts: 5658
27 May 2016 06:17 PM
I am sorry I bumped this, but I had the same problem.... So please goto my post located here:

https://forum.roblox.com/Forum/ShowPost.aspx?PostID=189852645

and help me make this issue known to roblox developers. The property works, it just fails to replicate to clients... so you have to manually set it using a local script in StarterPlayerScripts.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image