Tomboking
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 461 |
|
|
| 23 Dec 2014 04:22 PM |
| What script line is it to stop a script from running half way through without putting remove()? |
|
|
| Report Abuse |
|
|
golfercab
|
  |
| Joined: 26 Sep 2011 |
| Total Posts: 714 |
|
|
| 23 Dec 2014 04:33 PM |
if it is a loop such as for i,v in pairs () do .... or a repeat untill then inside the loop add the word "break" and it will exit the loop and continue on. Now, if you want the script to pause at a certain part until something happens then I would do something such as
repeat wait(1) until ... maybe add a bool value in the workspace or inside a model the script is in, where ever so that you can change it and the script will check, see that its value matches the value in the "until" part of this loop and it will continue.
also, i thought remove() was an outdated version of destroy() which deletes an object and all of its children. If this confuses you or it doesn't help, please give more details about the situation you are in. |
|
|
| Report Abuse |
|
|
Tomboking
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 461 |
|
|
| 23 Dec 2014 11:56 PM |
So say I had this:
h.Health = h.Health +1 wait(0.025) h.Health = h.Health +1 wait(0.025) ----------- h.Health = h.Health +1 wait(0.025) h.Health = h.Health +1
How could I stop the character from healing half way through where I've put the dashes? |
|
|
| Report Abuse |
|
|
Tomboking
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 461 |
|
|
| 23 Dec 2014 11:58 PM |
| Sorry I mean pause so it can carry on healing the character later. |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2014 12:08 AM |
like golfer said, you can type in: "repeat wait() wait until" and put a condition or you can disable the script: script.Disabled = true or you can use "break" to stop the loop if you have one. |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 24 Dec 2014 12:15 AM |
Well remove and destroy have differenet functions
Destroy is better than remove though (For most purposes) |
|
|
| Report Abuse |
|
|
golfercab
|
  |
| Joined: 26 Sep 2011 |
| Total Posts: 714 |
|
|
| 24 Dec 2014 01:27 AM |
you could have a boolvalue in the player and have a loop
while (boolvalue) == true do wait(#) --healing line of code in here end |
|
|
| Report Abuse |
|
|
Tomboking
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 461 |
|
|
| 27 Dec 2014 12:36 AM |
So could I put:
"if h.MaxHealth then script.Disabled = true"
Would that work? |
|
|
| Report Abuse |
|
|
golfercab
|
  |
| Joined: 26 Sep 2011 |
| Total Posts: 714 |
|
|
| 27 Dec 2014 08:54 AM |
idk, I would do
if h.Health == h.MaxHealth then
end
|
|
|
| Report Abuse |
|
|