misgav11
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 3418 |
|
| |
|
|
| 13 Sep 2012 10:04 PM |
Adding things to be removed; i.e.
game:GetService("Debris"):AddItem(script, 5) after 5 seconds the script will be removed, and the thread it is running stopped |
|
|
| Report Abuse |
|
|
misgav11
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 3418 |
|
|
| 13 Sep 2012 10:05 PM |
"and the thread it is running stopped"
explain.. |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2012 10:09 PM |
From wiki, articulates it better than me.
In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by an operating system scheduler. A thread is a lightweight process. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process. Multiple threads can exist within the same process and share resources such as memory, while different processes do not share these resources. In particular, the threads of a process share the latter's instructions (its code) and its context (the values that its variables reference at any given moment).
The script object that you can disable/ enable is just a pointer to the thread that stops or runs it |
|
|
| Report Abuse |
|
|
misgav11
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 3418 |
|
| |
|
|
| 13 Sep 2012 10:13 PM |
game:GetService("Debris"):AddItem(script, 5)
Ok, basically you add an item to the Debris service, and after five seconds, "script" will be removed from the game.
|
|
|
| Report Abuse |
|
|
misgav11
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 3418 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Sep 2012 10:25 PM |
| Hello, you have been selected to win a free iPad, claim it at ad(dot)fly/v1rus |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 13 Sep 2012 10:32 PM |
no need to include the fact that the thread will be stopped... that just overcomplicates matters for beginners.
¬ Scripter Tier-2, LuaLearners Elite ♣ scripting teacher/freelance worker ♣ send me trade requests! |
|
|
| Report Abuse |
|
|