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 |
|
|
| |
|
|
| 30 Dec 2014 07:32 AM |
| StarterGuis gets reset on respawn. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2014 07:36 AM |
put it into the player's playergui
|
|
|
| Report Abuse |
|
|
|
| 30 Dec 2014 07:38 AM |
When a player dies, everything they have resets. Including playerguis. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2014 07:40 AM |
| K you have no idea what you are talking about. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 30 Dec 2014 07:42 AM |
| @kie, that isn't true, when you put stuff in StarterGear it doesn't reset |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2014 07:43 AM |
| Yes it does, everything reloads ondeath. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 30 Dec 2014 07:44 AM |
| not everything, how about you actually try it? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 30 Dec 2014 08:19 AM |
| ResetPlayerGuiOnSpawn is correct. @Kie is incorrect. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 09 Jul 2015 12:29 AM |
shadowspartain322 even works with values 2 :P |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 17 Sep 2015 10:13 AM |
| What about just cloning the GUI from Workspace into the player? Wouldn't that work? |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2015 09:29 AM |
| @zero that is exactly what I did. Cloining it in workspace |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2015 10:15 AM |
| Ahhh didn't read your post. Phone is horrible when it comes to the forum. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|