Thread: scripting help?
View Single Post
Old
  (#42)
chipsdw is Offline
Senior Member
 
Posts: 103
Join Date: Dec 2002
  Send a message via AIM to chipsdw  
Default 08-28-2003, 06:39 PM

so... if i wanted to randomize the placement of a mine could i do this?

randommine1:
(this line names the thread
local.waitformine = (randomint(45) + 10)

local.rndnum = randomint(1000)
local.rndnum2 = randomint(1000)
local.rndnum3 = randomint(1000)

wait local.waitformine
spawn animate/fx_explosion_mine "targetname" "mine1"

$mine1.origin = ( -wait local.rndnum -wait local.rndnum2 -wait local.rndnum3)
(puts the mine in a specific place on the map
$mine1 anim start
if ($player == NULL)
local.dudes=0
else
local.dudes = $player.size
if (local.dudes > 0)
local.dude = exec global/makearray.scr $player
for (local.i=1;local.i<local.dudes+1;local.i++)
{
if (vector_length ($mine1.origin - local.dude[local.i].origin) < 300)
local.dude[local.i] exec global/bullethit.scr (0 -1 0) 800 50 1
}

wait 4

$mine1 remove

goto randommine1

end
  
Reply With Quote