【发布时间】:2021-01-20 13:51:46
【问题描述】:
【问题讨论】:
-
不要分享代码截图。文本作为文本共享...
标签: server lua localhost fivem
【问题讨论】:
标签: server lua localhost fivem
没有太多要添加到错误消息中的内容。您正在索引一个 nil 值 PlayerData。
索引 nil 值没有任何意义。
为避免此错误,仅索引 PlayerData(如果存在)或首先确保它存在。
这可能是因为事件的触发顺序错误。但是,您不应该处理可能不可用的数据。
【讨论】:
xPlayer 是什么?
if not PlayerData then return end 应该这样做。也许你应该在编写 Lua 脚本之前先做一个 Lua 初学者教程?