Script as promise
-----script Pcs
function ai_chair_talk_init(e)
SetAnimation(0)
stopamin1 = 0
stopamin2 = 0
stopamin3 = 0
stopamin4 = 0
stopamin5 = 0
once = 0
beenhere = 0
end
function ai_chair_talk_main(e)
PlayerDist = GetPlayerDistance(e)
--------- animation sit -------
if GetTimer(e)>4000 and stopamin1 == 0 then
SetAnimationFrames(3744,3744)
PlayAnimation(e)
stopamin1 = 1
StartTimer(e)
end
if PlayerDist < 200 then
------ animation standing up -----
if GetTimer(e)>5000 and stopamin2 == 0 then
SetAnimationFrames(3744,3861)
PlayAnimation(e)
stopamin2 = 1
StartTimer(e)
PlaySound(e,4)
end
----------animation idle -------
if GetTimer(e)>5000 and stopamin3 == 0 then
stopamin3 = 1
SetAnimationFrames(3000,3100)
LoopAnimation(e)
--stopamin3 = 1
StartTimer(e)
if beenhere == 0 then
PlaySound(e,1)
end
if beenhere == 1 then
PlaySound(e,2)
end
if beenhere == 2 then
PlaySound(e,3)
end
beenhere = beenhere +1
end
---------animation fidge ------
if GetTimer(e)>5009 and stopamin4 == 0 then
SetAnimationFrames(3440,3700)
PlayAnimation(e)
stopamin4 = 1
StartTimer(e)
end
------ animation idle ----
if GetTimer(e)>5000 and stopamin5 == 0 then
SetAnimationFrames(3000,3100)
LoopAnimation(e)
stopamin5 = 1
StartTimer(e)
end
end
if PlayerDist > 201 then
if beenhere == 1 then
stopamin2 = 0
stopamin3 = 0
end
if beenhere == 2 then
stopamin2 = 0
stopamin3 = 0
end
if beenhere == 3 then
beenhere = 1
end
------animation sit -------
if GetTimer(e)>1000 and stopamin1 == 1 then
SetAnimationFrames(3744,3744)
LoopAnimation(e)
stopamin1 = 0
StartTimer(e)
end
end
end -- off script --
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11