How does chair fall over?
Posted: Sat Oct 25, 2003 4:51 pm
I have a ai sitting in a chair and when I shoot him, he falls out of the chair. How do you make the chair fall or tip over when the ai is shot?
chairdeath:
// local.chair = self.chair
// local.rand = randomint (10)
self waittill death
if (self.fighting == 0)
{
self.chair delete
local.chair = spawn script_model
local.chair model "furniture/cardchair.tik"
local.chair.origin = self.origin
local.chair.angles = self.angles
if (self.chairdeath == "chair_death_forwards")
local.chair solid
else
local.chair notsolid
waitframe
println ("Chair is playing animation " + self.chairdeath)
local.chair anim self.chairdeath
wait 3
local.chair anim (self.chairdeath + "_end")
println ("Chair is playing animation " + (self.chairdeath + "_end"))
waitframe
}
// wait 2
end
if (randomint (100) > 50)
self.chairdeath = "chair_death_forwards"
else
self.chairdeath = "chair_death_backwards"
self.fighting = 0
self thread chairdeath
Code: Select all
chairdeath:
// local.chair = self.chair
// local.rand = randomint (10)
self waittill death
if (self.fighting == 0)
{
self.chair delete
local.chair = spawn script_model
local.chair model "furniture/cardchair.tik"
local.chair.origin = self.origin
local.chair.angles = self.angles
if (self.chairdeath == "chair_death_forwards")
local.chair solid
else
local.chair notsolid
waitframe
println ("Chair is playing animation " + self.chairdeath)
local.chair anim self.chairdeath
wait 3
local.chair anim (self.chairdeath + "_end")
println ("Chair is playing animation " + (self.chairdeath + "_end"))
waitframe
}
// wait 2
endCode: Select all
if (randomint (100) > 50)
$Perin.chairdeath = "chair_death_forwards"
else
$Perin.chairdeath = "chair_death_backwards"
$Perin.fighting = 0
$Perin thread chairdeath
while(isAlive $Perin)
{
$chair show
waitframe
}
$chair deleteCode: Select all
while(isAlive $Perin)
{
$chaira hide
waitframe
}
$chaira show
while(isAlive $Perin)
{
$chair show
waitframe
}
$chair delete