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: Why won't this script destroy its parent?

Previous Thread :: Next Thread 
l0lzz is not online. l0lzz
Joined: 05 Dec 2009
Total Posts: 1529
05 Mar 2012 11:37 AM
The time goes down but it never destroys its parent, when it hits 0 it goes back to 20 and stays there.



Gate = game.Workspace.Gate
Text = script.Parent.Frame.TimeLeft
Time = Gate.Time

while wait() do
repeat
wait(1)
Text.Text = Time.Value
until Time.Value == 0
script.Parent:Destroy()
end
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
05 Mar 2012 11:41 AM
Dont have the while-do loop then.
Report Abuse
l0lzz is not online. l0lzz
Joined: 05 Dec 2009
Total Posts: 1529
05 Mar 2012 11:42 AM
Still doesn't destroy it...


Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
05 Mar 2012 11:44 AM
Is the script in workspace? Are you trying to remove the script or it's first ascendant?

"Bro five! Wear this to let everyone know you think they deserve a high five."
Report Abuse
l0lzz is not online. l0lzz
Joined: 05 Dec 2009
Total Posts: 1529
05 Mar 2012 11:46 AM
I got it to delete while it's in the player's PlayerGui, but how do I remove it from StarterGui?
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
05 Mar 2012 11:47 AM
It doesn't run in StarterGui

"Bro five! Wear this to let everyone know you think they deserve a high five."
Report Abuse
l0lzz is not online. l0lzz
Joined: 05 Dec 2009
Total Posts: 1529
05 Mar 2012 11:50 AM
So I put I cloned the Gui from lighting into each person then put it in StarterGui in case they died. I need it to destroy in StarterGui when the gate is repaired....
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
05 Mar 2012 11:57 AM
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
if gate is not destroyed then --Obviously change
game.Lighting.Gui:clone().Parent=plr.PlayerGui
end
end)
end)

"Bro five! Wear this to let everyone know you think they deserve a high five."
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
05 Mar 2012 11:58 AM
"if gate is not destroyed then --Obviously change "

Oops, 'Destroyed' as in the event. Instead do "if gate then"

"Bro five! Wear this to let everyone know you think they deserve a high five."
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
05 Mar 2012 12:01 PM
"if gate is not destroyed then"

uumg syntax error blahblah expected around blahblah and blahblah
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
05 Mar 2012 12:02 PM
One line of pseudocode is quite misunderstanding, indeed.

"Bro five! Wear this to let everyone know you think they deserve a high five."
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
05 Mar 2012 12:05 PM
"Why won't this script destroy its parent?"

Since when are children expected to kill members of their family?
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
05 Mar 2012 12:06 PM
When they get mad..
Report Abuse
JulienDethurens is not online. JulienDethurens
Joined: 11 Jun 2009
Total Posts: 11046
05 Mar 2012 12:08 PM
@su8

Erm, but, why would the script be mad at its parent? Just because a certain gate has been destroyed?

Oh, I think I understand! The gate was a friend of the script and the _GUI_ destroyed the gate?

Wait, the > GUI < destroyed the gate? Since when can a _GUI_ destroy a gate?

No, no... wait, wait... hum...
Report Abuse
l0lzz is not online. l0lzz
Joined: 05 Dec 2009
Total Posts: 1529
05 Mar 2012 12:08 PM
Ok so back on topic. xD
The Gui won;t clone into the player?



Gate = script.Parent
Health = Gate.Health
Gui = game.Lighting.TimeLeftGui

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
if Health.Value == 0 then
Gui:Clone().Parent = plr.PlayerGui
end
end)
end)
Report Abuse
l0lzz is not online. l0lzz
Joined: 05 Dec 2009
Total Posts: 1529
05 Mar 2012 12:18 PM
Bumpers ;(
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