This is fantastic Harry - thank you!
Really brilliant
I imagine smallg will arrive soon with a great script, but here's an updated one until then (hope you don't mind):
-- Starts Astragate animation when player is close (change startupDistance if needed)
-- When 'water' portal opens after animation completes, walking into the portal will
-- transport the player to the entity named in the astragate_ring 'IfUsed' field
-- nb: enter the astragate_center's 'e' number below too!
local astragate_center_e = 3
local startupDistance = 350
--
local open = 0
function astragate_init(e)
Hide(astragate_center_e)
CollisionOff(astragate_center_e)
end
function astragate_main(e)
if GetPlayerDistance(e) < startupDistance then
if open == 0 then
if g_Entity[e]['animating'] == 0 then
SetAnimation(0)
SetAnimationSpeed(e,200)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
open = 1
LoopSound(e,0)
return
end
end
if open == 1 then
if g_Entity[e]['animating'] == 0 then
Show(astragate_center_e)
StopSound(e,0)
LoopSound(e,1)
open = 2
end
end
if open == 2 then
if GetPlayerDistance(e) < 50 then
TransportToIfUsed(e)
end
end
else
open = 0
StopSound(e,0)
StopSound(e,1)
StopAnimation(e)
Hide(astragate_center_e)
end
end