Over- redundant question but...
This script is attached to the ladder?
Just sat down and worked out a decent ladder script (at least I think so...!)
Works better than my hidden platform one made some time back.
Enter from top or bottom both work just as well. Change height to suite--
so of course you can customize for each ladder if different heights.
{{Up to you to add animations if 3rd person}}
Test it out;
local ladderactive = {}
local moveup = {}
local playeratx = {}
local playeraty = {}
local ladderheight = {}
function ladder_init(e)
ladderactive[e] = 0
moveup[e] = 0
ladderheight[e] = 300
end -- init
function ladder_main(e)
playeratx[e] = 0
playeraty[e] = 0
if math.abs(g_PlayerPosX - g_Entity[e]['x']) < 25 then
playeratx[e] = 1
if math.abs(g_PlayerPosZ - g_Entity[e]['z']) < 25 then
playeraty[e] = 1
if ladderactive[e] == 0 then
moveup[e] = g_PlayerPosY
ladderactive[e] = 1
end
end
end
if playeratx[e] + playeraty[e] < 2 then ladderactive[e] = 0 end
if ladderactive[e] == 1 then --------- on ladder so activate climb
Prompt("Press 'A,X,D' to exit ladder")
if g_Scancode == 17 then
if moveup[e] < g_Entity[e]['y'] + ladderheight[e] then moveup[e] = moveup[e] + 2 end -- 'W' up
end
if g_Scancode == 31 then
if moveup[e] > g_Entity[e]['y'] + 35 then moveup[e] = moveup[e] - 2 end -- 'S' down
end
if g_Scancode == 45 then ForcePlayer( g_PlayerAngY + 180, 1) end -- 'X' to exit ladder
if g_Scancode == 30 then ForcePlayer( g_PlayerAngY - 90, 1) end -- 'A' left
if g_Scancode == 32 then ForcePlayer( g_PlayerAngY + 90, 1) end -- 'D' right
SetFreezePosition(g_PlayerPosX, moveup[e], g_PlayerPosZ)
TransportToFreezePositionOnly()
end --------- on ladder so activate climb
end -- main