Page 1 of 1

Trigger Question

Posted: Sat May 08, 2004 2:08 am
by meowmix11
How can I make a trigger that you could only come back to after five minutes? Here is my cuttent trigger:

Code: Select all

allweap: 

local.trig1 = spawn trigger_multiple 
local.trig1.origin = ( 227.94 474.40 384.13 ) //axis 
local.color = ( 0.0 1.0 0.0 ) 
local.trig1 setsize ( -50 -50 -50 ) ( 50 50 50 ) 
local.trig1 setthread  all1 
local.trig1 message "*****You will now have all weapons. You can come back every 5 minutes*****" 
local.trig1 wait 4 
local.trig1 delay 0 

all1: 

self waittill trigger 

local.player=parm.other 

if (local.player.isall1==1) 

end 

 

local.player.isall1=1 

local.player wuss 

wait 5 

local.player volumedamage 1 

local.player.isall1=0 

end 
Can anyone help?

Posted: Sat May 08, 2004 3:32 am
by Combat Kirby
Add these lines right after your: if (local.player.isall1==1) end


Code: Select all

	if(local.player.player_time == NIL)
	{
		local.player.player_time = level.time //let him in his first time
	}
	else if((level.time - local.player.player_time) < 300.0) //5 minutes in seconds
	{
		local.player iprint "5 Minutes has not past since last been here!"
		end
	}	
	else
	{
		local.player.player_time = level.time
	}

Also, remove the waittill trigger line and the wait 5, you don't need them.
And add the command "end" right after: local.trig1 delay 0 or else your trigger setup code will run into your trigger thread.
You are already using 'setthread' for the trigger so you don't need the 'waittill trigger' line.

Regards,
Kirby.
[/code]