Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local turret = piece "sstowgab"
- local turret2= piece "sstower"
- local flare = piece "sscflare"
- --define other pieces
- local sstowf = piece "sstowf"
- local sstowf2 = piece "sstowf2"
- local body = piece "csniper"
- local cwheel1 = piece "sswheel"
- local cwheel2 = piece "sswheel2"
- local cwheel3 = piece "sswheel3"
- local cwheel3 = piece "sswheel4"
- local SIG_UNFOLD=8
- local SIG_FOLD=4
- local SIG_AIM=2
- local SIG_SPAM=16
- local boolStillAiming=false
- local boolFireLock=true
- local spamfilterSTART=true
- local spamfilterSTOP=false
- local boolFilterActive=false
- local function spamFilter()
- SetSignalMask(SIG_SPAM)
- while (true) do
- if spamfilterSTART==true and spamfilterSTOP==false then
- for it=0,3,1
- do
- Sleep(64)
- if spamfilterSTOP==true then
- spamfilterSTART=false
- break
- end
- end
- if spamfilterSTART==true then
- --if spamfilterSTART is still ==true then
- Signal(SIG_FOLD)
- Signal(SIG_UNFOLD)
- StartThread(fold)
- end
- end
- if spamfilterSTOP==true and spamfilterSTART==false then
- for it=0,3,1
- do
- Sleep(64)
- if spamfilterSTART==true then
- spamfilterSTOP=false
- break
- end
- end
- if spamfilterSTOP==true then
- --if spamfilterSTOP is still ==true then
- Signal(SIG_FOLD)
- Signal(SIG_UNFOLD)
- StartThread(unfold)
- end
- end
- if spamfilterSTOP==false and spamfilterSTART==false then
- Spring.Echo("No idea what you did, but you broke it. You gonna pay!")
- end
- end
- end
- local function fold()
- Signal(SIG_UNFOLD)
- SetSignalMask(SIG_FOLD)
- Turn(turret,x_axis,math.rad(0),1.2)
- Sleep(150)
- Turn(turret, x_axis,math.rad(0),1.85)
- Turn(turret2, x_axis,math.rad(0),1.85)
- Turn(sstowf2,y_axis,math.rad(180),4)
- WaitForTurn(sstowf2,y_axis)
- WaitForTurn(turret2, x_axis)
- Move(sstowf,y_axis, -65,6)
- WaitForMove(sstowf,y_axis)
- Sleep(50)
- Hide(sstowf)
- Hide(sstowf)
- boolFireLock=true
- while(true) do
- Sleep(1024)
- end
- end
- local function unfold()
- Signal(SIG_FOLD)
- SetSignalMask(SIG_UNFOLD)
- Show(sstowf)
- Show(sstowf)
- turner=math.random(-2,2)
- Turn(turret,x_axis,math.rad(turner),1)
- WaitForTurn(turret,x_axis)
- Move(sstowf,y_axis, 0,5)
- WaitForMove(sstowf,y_axis)
- boolFireLock=false
- while(true) do
- Sleep(1024)
- end
- end
- function script.AimWeapon1(heading ,pitch)
- Signal(SIG_AIM)
- SetSignalMask(SIG_AIM)
- if boolFireLock==true then
- return false
- end
- if boolFireLock==false then
- boolStillAiming=true
- --aiming animation: instantly turn the gun towards the enemy
- Turn(sstowf, y_axis, heading,0.85)
- Turn(turret2, x_axis, -pitch,0.55)
- WaitForTurn(sstowf,y_axis)
- WaitForTurn(turret2,x_axis)
- return true
- end
- end
- function script.AimFromWeapon1()
- return turret2
- end
- function script.QueryWeapon1()
- return flare
- end
- function script.FireWeapon1()
- boolStillAiming=false
- return true
- end
- function script.Create()
- Hide(flare)
- Signal(SIG_SPAM)
- end
- function script.Killed()
- Signal(SIG_SPAM)
- Signal(SIG_FOLD)
- Signal(SIG_UNFOLD)
- flipFlop=math.random(0,1)
- if flipFlop==1 then
- Turn(sstowf2,x_axis,math.rad(35),2)
- WaitForTurn(sstowf2,x_axis)
- Turn(sstowf2,x_axis,math.rad(78),6)
- WaitForTurn(sstowf2,x_axis)
- Turn(sstowf2,x_axis,math.rad(92),9)
- WaitForTurn(sstowf2,x_axis)
- Sleep(250)
- Explode (cwheel1, SFX.FIRE)
- Explode (cwheel2, SFX.FIRE)
- Explode (cwheel3, SFX.FIRE)
- Explode (cwheel3, SFX.FIRE)
- Explode (turret2, SFX.SMOKE)
- Explode (body, SFX.FIRE + SFX.SMOKE)
- end
- if flipFlop==0 then
- Turn(body,z_axis,math.rad(35),2)
- WaitForTurn(body,z_axis)
- Turn(body,z_axis,math.rad(78),6)
- WaitForTurn(body,z_axis)
- Turn(body,z_axis,math.rad(93),9)
- WaitForTurn(body,z_axis)
- Turn(body,z_axis,math.rad(85),6)
- WaitForTurn(body,z_axis)
- Turn(body,z_axis,math.rad(93),9)
- WaitForTurn(body,z_axis)
- Sleep(250)
- Explode (cwheel1, SFX.FIRE)
- Explode (cwheel2, SFX.FIRE)
- Explode (cwheel3, SFX.FIRE)
- Explode (cwheel3, SFX.FIRE)
- Explode (turret2, SFX.SMOKE)
- Explode (body, SFX.FIRE + SFX.SMOKE)
- end
- end
- function script.StartMoving()
- if boolFilterActive==false then
- Signal(SIG_SPAM)
- StartThread(spamFilter)
- boolFilterActive=true
- end
- spamfilterSTOP=false
- spamfilterSTART=true
- end
- function script.StopMoving()
- -- Spring.Echo ("stopped walking!")
- spamfilterSTART=false
- spamfilterSTOP=true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement