查看: 22|回复: 0
收起左侧

[随笔心得] 如何在禁用服务器内的兔子跳行为

[复制链接]
admin 发表于 2025-2-13 17:08:05 | 显示全部楼层 |阅读模式
复制代码,将其粘贴到您的任意client.lua 中,然后重新启动脚本以强制角色在两到三次跳跃后落地。
Citizen.CreateThread(function()

    while true do

        Citizen.Wait(100)

        local ped = PlayerPedId()

        if IsPedOnFoot(ped) and not IsPedSwimming(ped) and (IsPedRunning(ped) or IsPedSprinting(ped)) and not IsPedClimbing(ped) and IsPedJumping(ped) and not IsPedRagdoll(ped) then

            local chance_result = math.random()

            if chance_result < 0.50 then

                Citizen.Wait(600)

                SetPedToRagdoll(ped, 5000, 1, 2)

            else

                Citizen.Wait(2000)

            end

        end

    end

end)



[发帖际遇]: admin 在论坛发帖时没有注意,被小偷偷去了 7 贡献. 幸运榜 / 衰神榜
楼主热帖
回复 论坛版权

使用道具 举报

文明发言,和谐互动
文明发言,和谐互动
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|FiveM技术教程分享 ( 冀ICP备2021005225号-1 ) |网站地图

GMT+8, 2025-4-18 09:32 , Processed in 0.119588 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表