전략게시판

전략게시판 [스튜디오]
랭킹 1등부터 3등까지 실시간 스크립트
2020.03.02 01:45 조회 : 680
Lv. 723XtremeBhop CosyClimbing 작성자 게시물 더보기

Count1 = Game.SyncValue:Create ('Count1')
Count2 = Game.SyncValue:Create ('Count2')
Count3 = Game.SyncValue:Create ('Count3')
Count1_name = Game.SyncValue:Create ('Count1_name')
Count2_name = Game.SyncValue:Create ('Count2_name')
Count3_name = Game.SyncValue:Create('Count3_name')
Count1_name.value = tostring("--")
Count2_name.value = tostring("--")
Count3_name.value = tostring("--")
Count1.value = 0
Count2.value = 0
Count3.value = 0


function Game.Rule:OnKilled(victim, killer) -- 사망 시 발동하는 이벤트 함수(실질적인 랭킹 스크립트)
 if killer ~= nil and killer ~= victim == true then
  if victim:IsPlayer() == true and killer:IsPlayer() == true then
   Man = Game.Player:Create(killer.index)
   if killer.user.point > Count1.value then
    if Count1_name.value ~= Man.name then
     if Count2_name.value ~= Man.name then
      Count3.value = Count2.value
      Count3_name.value = Count2_name.value
      Count2.value = Count1.value
      Count2_name.value = Count1_name.value
     else
      Count2.value = Count1.value
      Count2_name.value = Count1_name.value
     end
    end
    Count1.value = tonumber(Man.user.point)
    Count1_name.value = Man.name
    
   elseif killer.user.point > Count2.value and Count1_name.value ~= Man.name then
    if Count2_name.value ~= Man.name then
     Count3.value = Count2.value
     Count3_name.value = Count2_name.value
    end
    Count2.value = tonumber(Man.user.point)
    Count2_name.value = Man.name
    
   elseif killer.user.point > Count3.value and Count1_name.value ~= Man.name and Count2_name.value ~= Man.name then
    Count3.value = tonumber(Man.user.point)
    Count3_name.value = Man.name
   end
  end
 end
end



function Game.Rule:OnPlayerConnect(player) -- 접속 시 0포인트 지급
 player.user.point = 0

 PointCheck()

end


function Game.Rule:OnPlayerDisconnect(player) -- 퇴장 시 포인트 제거

 player.user.point = nil
 PointCheck()
end


function PointCheck() -- 포인트 저장하는 테이블
 if Players == nil then Players = {} end
 for i=1, 32 do
  Players.i = Game.Player:Create (i)
  if Players.i == nil then return end
 end
end

추천 : 1
댓글을 남기시려면 로그인 해주세요
댓글 : 3
  • 그럼요 ㅋㅋㅋ Lv. 66익스트림트롤 2020.03.02
  • 무슨 스크립트엿는지 기억하시죠 ㅋㅋㅋ Lv. 723XtremeBhop 2020.03.02
  • 따봉! Lv. 66익스트림트롤 2020.03.02