안녕하세요,
앞잡이입니다.
탤레포트 쓰고 싶은분들 많으신데
아래를 복사해서 스크립트에 담으면 됩니다.
키는 D입니다
#=================================================
# ■ 텔레포트 스크립트
#-------------------------------------------------
# 기존 대쉬 스크립트를 플레이어를
# 순간이동 시키도록 만들었습니다
# 움직이는동안 D키를 누르면 됩니다
# 수정:kcss
#=================================================
Animation = 2
Con_sp = 2
class Game_Player #클래스 지정 입니다.
alias teleport_update update
def update #업데이트
if Input.trigger?(Input::Z) #Z버튼을 눌렀을때 시작
unless $game_party.actors[0].sp < Con_sp
case @direction
when 2 # 하
if Input.press?(Input::DOWN)
$game_player.animation_id = Animation
$game_party.actors[0].sp -= Con_sp
moveto($game_player.x, $game_player.y+2)
else
moveto($game_player.x, $game_player.y)
end
when 4 # 왼쪽
if Input.press?(Input::LEFT)
$game_player.animation_id = Animation
$game_party.actors[0].sp -= Con_sp
moveto($game_player.x-2, $game_player.y)
else
moveto($game_player.x, $game_player.y)
end
when 6 # 오른쪽
if Input.press?(Input::RIGHT)
$game_player.animation_id = Animation
$game_party.actors[0].sp -= Con_sp
moveto($game_player.x+2, $game_player.y)
else
moveto($game_player.x, $game_player.y)
end
when 8 # 상
if Input.press?(Input::UP)
$game_player.animation_id = Animation
$game_party.actors[0].sp -= Con_sp
moveto($game_player.x, $game_player.y-2)
else
moveto($game_player.x, $game_player.y)
end
end
end
end
teleport_update
end
end