Killing a Looping Thread

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Killing a Looping Thread

Post by MPowell1944 »

Alright. Here is my problem. I have a trigger that makes a player warp his scale via a looping thread. I have another trigger that make the player normal size again, however, the first trigger uses while(isAlive local.player), and because of this, if the player is still alive while hitting the 2nd trigger, it won't stop his scale warping. What I want to do instead is to kill that looping thread when he touches the 2nd trigger so that he becomes a normal size again.

This is a difficult task and have gotten close but still no 100% solution. Anyone know how this could be done?
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

use maybe

Code: Select all

while(isalive local.player || local.player.becomenormal ==0)
{
//\/\/\/\/\/\/\/
-------------


then in your warp trigger put

Code: Select all

local.player.becomenormal =0
then in the normalise trigger put

Code: Select all

local.player.becomenormal =1
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

in the other triggers have a command that turns the scale back to normal,add it to all the triggers.that way itll make them normal size then perform the other triggers command.sound close?

:?
Image
Elgan
Site Admin
Posts: 890
Joined: Tue Apr 13, 2004 10:43 pm
Location: uk
Contact:

Post by Elgan »

Green Beret wrote:in the other triggers have a command that turns the scale back to normal,add it to all the triggers.that way itll make them normal size then perform the other triggers command.sound close?

:?
but his loop will cancel that command
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Do as Elgans says... but with && instead of || :wink:
Image
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

Ok I got it to work with what Elgan stated, however, it affected all players, not the local.player. That and it wasn't working as it should. Instead of continuously warping the player, it would start and stop randomly.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Obviously no one will be able to help you if you don't post the code ;)
Image
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

It is ok. I'll retire that idea.
Post Reply