roblox - Roblox 武器套件在移动到复制存储时会损坏
问题描述
我已尝试应用此处发布的修复程序,但仍然无法正常工作。我的游戏中有一把来自武器套件的武器。我已按照此处的建议将 WeaponsSystem 文件夹移至 ReplicatedStorage 。游戏开始时,我的武器会在几秒钟后消失。
我已经删除了 ServerWeaponsScript 第 60 行的条件,并且我还注释掉了任何引用 curWeaponsSystemFolder 的内容。无法让它工作。我在下面发布了我的更改,包括我注释掉的所有行。
-- local curWeaponsSystemFolder = script.Parent
--if weaponsSystemFolder == nil then
-- weaponsSystemFolder = curWeaponsSystemFolder:Clone()
-- initializeWeaponsSystemAssets()
-- weaponsSystemFolder.Parent = ReplicatedStorage
--end
--if ServerScriptService:FindFirstChild("ServerWeaponsScript") == nil then
script.Parent = ServerScriptService
initializeWeaponsSystemAssets()
local WeaponsSystem = require(weaponsSystemFolder.WeaponsSystem)
if not WeaponsSystem.doingSetup and not WeaponsSystem.didSetup then
WeaponsSystem.setup()
end
local function setupClientWeaponsScript(player)
local clientWeaponsScript = player.PlayerGui:FindFirstChild("ClientWeaponsScript")
if clientWeaponsScript == nil then
clientWeaponsScript = weaponsSystemFolder.ClientWeaponsScript:Clone()
clientWeaponsScript.Parent = player.PlayerGui
end
end
Players.PlayerAdded:Connect(function(player)
setupClientWeaponsScript(player)
end)
for _, player in ipairs(Players:GetPlayers()) do
setupClientWeaponsScript(player)
end
--end
--if curWeaponsSystemFolder.Name == "WeaponsSystem" then
-- curWeaponsSystemFolder:Destroy()
--end
解决方案
推荐阅读
- typescript - 我可以将类型限制为接口的值吗?
- flutter - 将设备模型放置在文本小部件中
- javascript - 如何将 json 数据从我的 jsp 页面发送到 spring rest 控制器
- python - 使用 matplotlib 的直方图
- image - 如何从文件字符串中分辨出什么样的文件
- python - 计算嵌套列表中重复项的出现次数
- node.js - 为什么我的命令没有输出到 NodeJS 的典型标准输出?
- javascript - 如何使用 Cognito 和 AWS Amplify 在社交登录中获取和传递 deviceKey?
- javascript - ReferenceError: t is not defined - 不存在 JS 错误
- sql-server - 我的 SQL Server 和 Azure 数据库之间的订阅连接错误