|
| 17 Apr 2012 11:25 AM |
script.Parent = nil
while true do print("lol") wait() end
-- still prints "lol" repeatedly.
fix it plz. |
|
|
| Report Abuse |
|
|
Sorcus
|
  |
 |
| Joined: 29 Nov 2010 |
| Total Posts: 3775 |
|
|
| 17 Apr 2012 12:00 PM |
Even with a wait the script still doesn't get booted? This is new.
~Sorcus |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 12:54 PM |
Yeah Sorcus, yet another flaw to roblox. Oh, and unban rossb654, please. :) |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 01:01 PM |
"Even with a wait the script still doesn't get booted? This is new."
I remember doing this in script builders in '09, to never have my script removed... |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 17 Apr 2012 01:09 PM |
| It is because you remove it incorrectly. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 01:10 PM |
..There's only two ways to remove a script.. By using another script or deleting it from the Workspace. What you could do is disable the script first then delete it afterwards. |
|
|
| Report Abuse |
|
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
|
| 17 Apr 2012 01:15 PM |
| Does the script work by creating a thread that is not affected by the existence of the script once executed? |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 01:18 PM |
| I'm quite a newbie to more complicated scripting, but why is script.Parent = nil necessary? |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 01:22 PM |
"It is because you remove it incorrectly."
No matter how you remove it, as long as the removal is done by the script itself, the script will continue running. The only other option is to make it error through, what would be wisest, the error function. Or to just return, outside of any function. It will stop it without having an extra error message, which is nice. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 01:44 PM |
@TheM
So? Try :Remove() or :Destroy(), it still runs.
@Sorcus
ogm hai.
@ross
no, unban xSIXx instead. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 02:05 PM |
If xSIXx is terminated, then unban both of them If it's just a timed ban, then SHADDAP |
|
|
| Report Abuse |
|
|
| |
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 17 Apr 2012 02:12 PM |
That is because the code is first progressed to the C side and then ASM, a Script is just an object desgined to contain code. If it runs once, and it gets removed - it wil lstill do its thing(s), because it's just an object.
Imagine it this way: You have string object with source (script object). Script reads string objext, stores it, executes it (C(++)-side).
It will keep 'running'. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 02:23 PM |
| I was looking forward to you saying something like that. Because now you're gonna explain why removing a script with another script, stops it completely. Also, in case you hadn't noticed, I was answering your "removing incorrectly" thingy. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 17 Apr 2012 02:26 PM |
| @oysi: I didn't think when I posted that :P |
|
|
| Report Abuse |
|
|
Maradar
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 4478 |
|
|
| 17 Apr 2012 02:27 PM |
print("lol") wait() script:remove() end |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 17 Apr 2012 02:28 PM |
| I think local scripts terminate when removed or destroyed. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 02:31 PM |
@Quenty Like I said, if you by any means remove a script by the script itself, the thread will continue to run. However, if you remove the script through another script, the script will get removed and the thread will stop running. It's doubtful localscripts act differently than normal scripts on this, seeing as in solo mode, localscripts are practically equal to normal scripts. I haven't tested though, but you probably were referring to what I just explained. |
|
|
| Report Abuse |
|
|
tom17121
|
  |
| Joined: 29 Dec 2010 |
| Total Posts: 969 |
|
|
| 17 Apr 2012 02:43 PM |
Think of Workspace as a Planet Earth everything inside
Think of Lighting as the Sky the times Ect:
Think of nil as a Invisible Gas but its still there and can be removed if you do it correctly
|
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 17 Apr 2012 03:04 PM |
| Think as of above's post never excisted. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 03:23 PM |
| Tom's trolling level: OVAR NINE THOUSAND!!! |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2012 03:24 PM |
^x2
wh....wha..............
what?
*mindblown*
~Techboy6601: The IDE guy~ |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 17 Apr 2012 03:27 PM |
@Oysi: Iseewhatyoudidthere (ik zie wat je daar deed)
ನ್ನಡ |
|
|
| Report Abuse |
|
|
HotThoth
|
  |
 |
| Joined: 24 Aug 2010 |
| Total Posts: 1176 |
|
|
| 17 Apr 2012 03:39 PM |
I really could've sworn that "script.Disabled script:Remove() wait()" used to disable the script as it's running... as long as there was a wait after the disable-remove to give the thread time to yield. Maybe it was behaving badly in 09, better in 10-11, and now is bad again? You're sure this isn't something that changed recently?
|
|
|
| Report Abuse |
|
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
|
| 17 Apr 2012 03:40 PM |
"script.Disabled script:Remove() wait()" Eh, I think you're wrong; it wouldn't disable the script. n00b.
~Sorcus |
|
|
| Report Abuse |
|
|