local frame=CreateFrame("Frame") frame:RegisterEvent("PLAYER_ENTERING_WORLD") frame:SetScript("OnEvent",function(self,event,...) local isLogin, isReload = ... if isLogin then -- your action here end end)