我在这个 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() -- Cancel
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() -- Done
FreezeEntityPosition(player, false)
LocalPlayer.state:set("inv_busy", false, true)
TriggerServerEvent('qb-meth:processed')
isProcessing = false
end, function() -- Cancel
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