function IsJumping(p) {
if(p.Action == 41) return 1; // (true)
else return 0; // (false)
}
function onPlayerMove(player, lastX, lastY, lastZ, newX, newY, newZ){
if(IsJumping(player)){
player.Speed.z += 1; // E---X---A---M---P---L---E
}
}
function IsFalling(p, Znew, Zlast) {
if(IsJumping(p)) return false;
if(Znew == Zlast) return false; // rarely happens if the player is continually moving, since you can barely find a straightforward surface so Z positions are almost always dynamic
local newZlower = (Znew < Zlast ? true : false);
if(newZlower) {
if(Zlast - Znew < 0.15) return false; // Not Falling (e.g, 11.3 - 11.2 = 0.1 is not a fall)
else return true; // > 0.15 is a fall (Approximate numbers - I didn't really calculate it precisely)
}
else {return false;} // Znew is bigger -> so climbing or going up somehow
}
function onPlayerMove(player, lastX, lastY, lastZ, newX, newY, newZ){
if(IsFalling(player, newZ, lastZ)) player.Immunity = 32; // E---X---A---M---P---L---E
}
Quote from: Xmair on Oct 22, 2025, 08:53 PMYou could use Script::ScriptProcess
function Player::PlayerMove(oldpos, newpos){
}
Quote from: vitovc on Oct 21, 2025, 03:44 PMthere is no clientside player.Angle but you can 1) get it from server (with lag) with Stream function 2) or you can guess player's camera angle (it almost same as player.Angle when player is not looking back)get_angle <- function(x, y, x2, y2){untested, I took code from Get player Camera zoom
return ::atan2(y2 - y, x2 - x);
}
get_player_angle <- function(){
local screen_size = ::GUI.GetScreenSize();
local cam_from = ::GUI.ScreenPosToWorld(::Vector(screen_size.X * 0.5, screen_size.Y * 0.5, -1));
local cam_to = ::GUI.ScreenPosToWorld(::Vector(screen_size.X * 0.5, screen_size.Y * 0.5, 1));
return ::get_angle(cam_from.X, cam_from.Y, cam_to.X, cam_to.Y);
}local angle = ::get_player_angle();also maybe you will need to add some offset to result of angle to make it similar as serverside angle, to do it correctly usenormalize_angle <- function (a){
return ::atan2(::sin(a), ::cos(a));
}
::normalize_angle(angle + 1.57079);
get_angle <- function(x, y, x2, y2){
return ::atan2(y2 - y, x2 - x);
}
get_player_angle <- function(){
local screen_size = ::GUI.GetScreenSize();
local cam_from = ::GUI.ScreenPosToWorld(::Vector(screen_size.X * 0.5, screen_size.Y * 0.5, -1));
local cam_to = ::GUI.ScreenPosToWorld(::Vector(screen_size.X * 0.5, screen_size.Y * 0.5, 1));
return ::get_angle(cam_from.X, cam_from.Y, cam_to.X, cam_to.Y);
}
untested, I took code from Get player Camera zoom local angle = ::get_player_angle();also maybe you will need to add some offset to result of angle to make it similar as serverside angle, to do it correctly usenormalize_angle <- function (a){
return ::atan2(::sin(a), ::cos(a));
}
::normalize_angle(angle + 1.57079);