Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Pillars destroyed
- On (CustomEvent("Destroy Pillars")),
- function()
- if Pillar01:IsDestroyed()
- then
- print ("Trial Beast has destroyed one of the pillars!")
- if not Pillar02:IsDestroyed()
- then
- BridgeHolder:DestroyOnePhase(false)
- TrialPit_Bridge:DestroyOnePhase(false)
- Sound_BridgePhase:PlayOnce()
- ForceField:Enable()
- Wait(Delay(3))
- ForceField:Disable()
- end
- else
- print ("Kill the beast!")
- end
- if Pillar02:IsDestroyed()
- then
- print ("Trial Beast has destroyed one of the pillars!")
- if not Pillar01:IsDestroyed()
- then
- BridgeHolder:DestroyOnePhase(false)
- TrialPit_Bridge:DestroyOnePhase(false)
- Sound_BridgePhase:PlayOnce()
- ForceField:Enable()
- Wait(Delay(3))
- ForceField:Disable()
- end
- else
- print ("Kill the beast!")
- end
- end,
- -- Collapse the bridge when all pillars have been destroyed
- On (CustomEvent("Bridge Collapse")),
- function()
- if Pillar01:IsDestroyed() and Pillar02:IsDestroyed()
- then
- AnimatedMover_Bridge:PlayAnimWait("Bridge_Fall")
- Sound_BridgeCollapse:PlayOnce()
- Sound_BridgeCollapse_2:PlayOnce()
- Wait(Delay(0.1))
- -- WorldInfo : CWorldInfoEntity
- local WorldInfo = TrialPit_Bridge:GetWorldInfo()
- local TrialBeast_Script = WorldInfo:GetEntityByName("TrialBeast_Boss")
- local vMover = TrialPit_Bridge:GetPlacement():GetVect()
- print ("mover", vMover.x, vMover.y, vMover.z)
- for i, B in ipairs(TrialBeast_Script) do -- B : CLeggedPuppetEntity
- local vP = B:GetPlacement():GetVect()
- print ("Trial Beast", vP.x, vP.y, vP.z)
- local v = vP-vMover
- print ("delta", v.x, v.y, v.z)
- if v.y<0 and mthAbsF(v.x)<6 and mthAbsF(v.z)<14.9 then
- print (" killed")
- B:InflictDamageOfType(500000, "Crushing")
- end
- end
- Wait(Delay(0.6))
- Sound_BridgeImpact:PlayOnce()
- --Shaker
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement