Try this, not tested.
local BankEnter = createMarker(-2455.0500,503.7387,30.0776, "corona", 1.0, 255, 255, 255, 255)
local BankExit = createMarker(324.01458740234, 110.85294342041, 1007.9656982422, "corona", 1.0, 255, 255, 255, 255)
local thePlayer = getLocalPlayer()
addEventHandler("onMarkerHit", BankEnter,
function(hitElement)
if (getElementType(hitElement) == "vehicle") then return end
setElementFrozen( thePlayer, true )
setTimer( Unfreeze, 10000, 1, "Text" )
outputChatBox("You enter the bank", 255, 0, 0, false)
setInPosition(hitElement, 325.62298583984, 114.32950592041, 1007.9656982422, 0)
end)
addEventHandler("onMarkerHit", BankExit,
function(hitElement)
if (getElementType(hitElement) == "vehicle") then return end
setElementPosition(hitElement, -2452.828125, 504.38671875, 30.081373214722, 0)
end)
function Unfreeze()
setElementFrozen( thePlayer, false )
end
EDIT: If it's a client script, you will need to remove "local thePlayer = getLocalPlayer()" and add "thePlayer" into the correct areas.