Lua 脚本在第 448 行出现错误,在脚本末尾,我需要添加什么来结束脚本?
2021-12-16 11:40:26
收藏:0
阅读:263
评论:1
我在这个 Lua 脚本的末尾出现了一个错误,我不知道该如何结束这个脚本,错误信息如下
[脚本错误] https://i.stack.imgur.com/7BU2x.png
这里是从第 375 行到脚本末尾的内容。我不明白我应该如何结束这个脚本。我很新于编程,Lua 是我尝试学习的第一种语言。我会编辑免费脚本,以符合我的 FiveM GTA RP 服务器的需要,但我不知道如何结束这一切。感谢任何帮助,非常感激!:)
if dist <= 1 and not isProcessing then
sleep = 5
DrawText3D(process.x, process.y, process.z, '~b~E~w~ - Process Meth')
if IsControlJustPressed(1, 51) then
isProcessing = true
RegisterNetEvent('qb-coke:MakeMeth',function()
QBCore.Functions.TriggerCallback("qb-meth:getMeth",function(mix)
if mix then
QBCore.Functions.Progressbar('making_meth', 'Making Meth', 15000, false, true, {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
}, {}, {}, {}, function()
TriggerServerEvent('qb-meth:processed')
ClearPedTasks(PlayerPedId())
end, function() -- 取消
TriggerEvent('inventory:client:busy:status', false)
QBCore.Functions.Notify("Cancelled..", "error")
end)
else
QBCore.Functions.Notify("You don't have all ingredients!", "error")
end
end)
end)
function processing()
local player = PlayerPedId()
SetEntityCoords(player, process.x,process.y,process.z-1, 0.0, 0.0, 0.0, false)
SetEntityHeading(player, 160.84)
FreezeEntityPosition(player, true)
playAnim("anim@amb@clubhouse@tutorial@bkr_tut_ig3@", "machinic_loop_mechandplayer", 30000)
QBCore.Functions.Progressbar("meth-", "Making Meth", 0000, false, true, {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
}, {}, {}, {}, function() -- 完成
FreezeEntityPosition(player, false)
LocalPlayer.state:set("inv_busy", false, true)
TriggerServerEvent('qb-meth:processed')
isProcessing = false
end, function() -- 取消
isProcessing = false
ClearPedTasksImmediately(player)
FreezeEntityPosition(player, false)
end)
end
function cooldown()
Citizen.Wait(200)
TriggerServerEvent('qb-meth:updateTable', false)
end
function playAnimPed(animDict, animName, duration, buyer, x,y,z)
RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do
Citizen.Wait(0)
end
TaskPlayAnim(pilot, animDict, animName, 1.0, -1.0, duration, 49, 1, false, false, false)
RemoveAnimDict(animDict)
end
function playAnim(animDict, animName, duration)
RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do
Citizen.Wait(0)
end
TaskPlayAnim(PlayerPedId(), animDict, animName, 1.0, -1.0, duration, 49, 1, false, false, false)
RemoveAnimDict(animDict)
end
end
原文链接 https://stackoverflow.com/questions/70359451
点赞
评论区的留言会收到邮件通知哦~
推荐文章
- 如何在roblox studio中1:1导入真实世界的地形?
- 求解,lua_resume的第二次调用继续执行协程问题。
- 【上海普陀区】内向猫网络招募【Skynet游戏框架Lua后端程序员】
- SF爱好求教:如何用lua实现游戏内调用数据库函数实现账号密码注册?
- Lua实现网站后台开发
- LUA错误显式返回,社区常见的规约是怎么样的
- lua5.3下载库失败
- 请问如何实现文本框内容和某个网页搜索框内容连接,并把网页输出来的结果反馈到另外一个文本框上
- lua lanes多线程使用
- 一个kv数据库
- openresty 有没有比较轻量的 docker 镜像
- 想问一下,有大佬用过luacurl吗
- 在Lua执行过程中使用Load函数出现问题
- 为什么 neovim 里没有显示一些特殊字符?
- Lua比较两个表的值(不考虑键的顺序)
- 有个lua简单的项目,外包,有意者加微信 liuheng600456详谈,最好在成都
- 如何在 Visual Studio 2022 中运行 Lua 代码?
- addEventListener 返回 nil Lua
- Lua中获取用户配置主目录的跨平台方法
- 如何编写 Lua 模式将字符串(嵌套数组)转换为真正的数组?
第一提示:错误信息。在这里唯一想到的 if 语句是
if IsControlJustPressed(1, 51) then
…第二提示:代码有正确的缩进,所以很明显在该 if 语句的缩进级别下没有结束。
第三提示:你有更多需要
end
的关键字,而你没有与之匹配的end
。检查你是否能够找到每个关键字的匹配
end
。从最内部的作用域开始检查。最后你会发现你没有为
if IsControlJustPressed(1, 51) then
编写结束语句...提示:如果你不能在脑中完成这个过程,请删除所有符合语法的代码,直到找到一个不符合语法的代码。