Помощь скрипта по ходьбе/бегу

PPpapdpaspda

Новичок
Автор темы
6
0
Всем привет, подкиньте пж скрипт на бег от одной кординаты к другой (6 кондинат) если понадобится могу скинуть кординаты

Забивал в нейронке выдало что-то типо того
local runLocations = {
{x = 100, y = 200, z = 10}, — первая точка
{x = 300, y = 400, z = 15}, — вторая точка
{x = 500, y = 600, z = 20} — третья точка
}

local runEnabled = false
local currentRunLocation = 1

function moveRunToPoint()
if runEnabled then
local x, y, z = runLocations[currentRunLocation].x, runLocations[currentRunLocation].y, runLocations[currentRunLocation].z
local distance = getDistanceBetweenPoints3D(x, y, z, getElementPosition(localPlayer))

if distance > 1 then
setPedControlState(localPlayer, "forwards", true)
setPedRotation(localPlayer, findRotation(x, y, getElementPosition(localPlayer)))
else
setPedControlState(localPlayer, "forwards", false)

currentRunLocation = currentRunLocation + 1
if currentRunLocation > #runLocations then
currentRunLocation = 1
end
end
end
end

function findRotation(x, y, x2, y2)
local t = -math.deg(math.atan2(x2 - x, y2 - y))
if t < 0 then
t = t + 360
end
return t
end

function toggleRunMode()
runEnabled = not runEnabled
if runEnabled then
end

addCommandHandler("run", toggleRunMode)
addEventHandler("onClientRender", root, moveRunToPoint)
На аризоне не работает
 

chromiusj

$IWishYouSweetDreams
Модератор
5,732
4,026
зачем так жить
1000018278.jpg
 
  • Нравится
Реакции: deleted-user-521122