function onThink(creature, interval)
local player = creature:getPlayer()
if not player then
return
end
local playerId = player:getId()
local status = player:isPremium()
if lastPremiumStatus[playerId] and not status then
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
player:teleportTo(player:getTown():getTemplePosition())
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
end
lastPremiumStatus[playerId] = status
end