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 » Scripting Helpers
Home Search
 

Re: PlayerGui reloading after death

Previous Thread :: Next Thread 
PanzerSchmit is not online. PanzerSchmit
Joined: 09 Apr 2009
Total Posts: 789
02 Mar 2014 10:56 AM
When player dies PlayerGui is reloading. I've got a script in Player which requires GUI to work. When player dies, script breaks and it doesnt work because of Gui reloading. Have you got any idea how to solve that problem?
Report Abuse
PanzerSchmit is not online. PanzerSchmit
Joined: 09 Apr 2009
Total Posts: 789
02 Mar 2014 11:25 AM
bump help
Report Abuse
PanzerSchmit is not online. PanzerSchmit
Joined: 09 Apr 2009
Total Posts: 789
02 Mar 2014 12:39 PM
bumpy bump
Report Abuse
PanzerSchmit is not online. PanzerSchmit
Joined: 09 Apr 2009
Total Posts: 789
03 Mar 2014 10:44 AM
bumpy bump bumping
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
03 Mar 2014 11:28 AM
Post your code.
Report Abuse
PanzerSchmit is not online. PanzerSchmit
Joined: 09 Apr 2009
Total Posts: 789
03 Mar 2014 11:58 AM
Ls = script.Parent.Parent.Values
BestTime = Ls.BestTime
LastTime = Ls.LastTime
Running = Ls.Running
TimesDid = Ls.TimeDid
LocalTime = Ls.LocalTime
CurrentFrame = script.Parent.Parent.PlayerGui.ScreenGui.CurrentFrame
WinnerFrame = script.Parent.Parent.PlayerGui.ScreenGui.WinnerFrame

Running.Changed:connect(function(Val)
if Running.Value then
while Running.Value do -- I want to break that loop while Val == false
wait(1)
LocalTime.Value = LocalTime.Value+1
end

elseif Running.Value == false then
CurrentFrame.Visible = false
WinnerFrame.Visible = true
LastTime.Value = (math.floor(LocalTime.Value))
TimesDid.Value = TimesDid.Value+1
WinnerFrame.LastTime.Text = (math.floor(LastTime.Value))
LocalTime.Value = -1
--
NewRecord = Instance.new("IntValue")
NewRecord.Name = LastTime.Value.." - "..script.Parent.Parent.Name
NewRecord.Parent = game.Lighting
--
if BestTime.Value >= LastTime.Value then
BestTime.Value = LastTime.Value
end
wait(7)
CurrentFrame.Visible = true
WinnerFrame.Visible = false
end
end)

while true do
wait()
CurrentFrame.CurrentTime.Text = (math.floor(LocalTime.Value%86400/3600))..":"..(math.floor(LocalTime.Value%3600/60))..":"..((LocalTime.Value%60))
CurrentFrame.BestTime.Text = (math.floor(BestTime.Value%86400/3600))..":"..(math.floor(BestTime.Value%3600/60))..":"..((BestTime.Value%60))
CurrentFrame.TimesDid.Text = TimesDid.Value.." try"
CurrentFrame.LastTime.Text = (math.floor(LastTime.Value%86400/3600))..":"..(math.floor(LastTime.Value%3600/60))..":"..((LastTime.Value%60))
end

Everything works fine, but it doesnt work after dying because there is no GUI for some time. Re-copying script wont work because it requires script to be in the same place, all the time. Script is put into PlayerGui with ScreenGui. I tried to put it directly into Player but it really doesnt work.
Report Abuse
EcIiptic is not online. EcIiptic
Joined: 12 Aug 2009
Total Posts: 13737
03 Mar 2014 12:01 PM
um

waitforchild("PlayerGui")

xd

#ScriptingHelper
Report Abuse
PanzerSchmit is not online. PanzerSchmit
Joined: 09 Apr 2009
Total Posts: 789
03 Mar 2014 12:13 PM
um

doesnt work

19:13:23.750 - CurrentTime is not a valid member of Frame
19:13:23.750 - Script 'Players.Player1.Backpack.MainScript', Line 42
19:13:23.765 - stack end

script.Parent.Parent.PlayerGui:WaitForChild("ScreenGui")

Ls = script.Parent.Parent.Values
BestTime = Ls.BestTime
LastTime = Ls.LastTime
Running = Ls.Running
TimesDid = Ls.TimeDid
LocalTime = Ls.LocalTime
CurrentFrame = script.Parent.Parent.PlayerGui.ScreenGui.CurrentFrame
WinnerFrame = script.Parent.Parent.PlayerGui.ScreenGui.WinnerFrame

Running.Changed:connect(function(Val)
if Running.Value then
while Running.Value do -- I want to break that loop while Val == false
wait(1)
LocalTime.Value = LocalTime.Value+1
end

elseif Running.Value == false then
CurrentFrame.Visible = false
WinnerFrame.Visible = true
LastTime.Value = (math.floor(LocalTime.Value))
TimesDid.Value = TimesDid.Value+1
WinnerFrame.LastTime.Text = (math.floor(LastTime.Value))
LocalTime.Value = -1
--
NewRecord = Instance.new("IntValue")
NewRecord.Name = LastTime.Value.." - "..script.Parent.Parent.Name
NewRecord.Parent = game.Lighting
--
if BestTime.Value >= LastTime.Value then
BestTime.Value = LastTime.Value
end
wait(7)
CurrentFrame.Visible = true
WinnerFrame.Visible = false
end
end)

while true do
wait()
CurrentFrame.CurrentTime.Text = (math.floor(LocalTime.Value%86400/3600))..":"..(math.floor(LocalTime.Value%3600/60))..":"..((LocalTime.Value%60))
CurrentFrame.BestTime.Text = (math.floor(BestTime.Value%86400/3600))..":"..(math.floor(BestTime.Value%3600/60))..":"..((BestTime.Value%60))
CurrentFrame.TimesDid.Text = TimesDid.Value.." try"
CurrentFrame.LastTime.Text = (math.floor(LastTime.Value%86400/3600))..":"..(math.floor(LastTime.Value%3600/60))..":"..((LastTime.Value%60))
end
Report Abuse
PanzerSchmit is not online. PanzerSchmit
Joined: 09 Apr 2009
Total Posts: 789
03 Mar 2014 01:02 PM
bump eh.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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