提问人:hard R 提问时间:11/11/2023 最后编辑:hard R 更新时间:11/11/2023 访问量:14
从 moduleScript 中拉取 GroupId
Pulling GroupId from moduleScript
问:
我正在开发 Roblox 开销 GUI,并且正在使用 moduleScript 作为值。它目前提取其喜欢的随机值,而不是遵守参数。
脚本的(相关)部分执行:
local userRankInGroup = plr:GetRankInGroup(32494019)
for _, division in pairs(config) do
local groupIdToCheck = division["Group Id"]
if userRankInGroup and userRankInGroup >= division["Minimum RankId"] and userRankInGroup <= division["Maximum RankId"] then
clonedUI.DivRank.Text = division["Regiment Name"]
clonedUI.DivRankShadow.Text = division["Regiment Name"]
clonedUI.regimentFrame.regimentIcon.Image = division["Image Id"]
clonedUI.regimentFrame.BackgroundColor3 = division["Regiment Color"]
print("Overhead GUI for".. plr .."has loaded successfully.")
break
else
end
end
moduleScript:
local regiments = {
["Office of The Inspector General"] = {
["Regiment Name"] = "OIG",
["Group Id"] = 32921091,
["Image Id"] = "http://www.roblox.com/asset/?id=14412072617",
["Regiment Color"] = Color3.new(0.435294, 0.372549, 0.0117647),
["Minimum RankId"] = 5,
["Maximum RankId"] = 250,
},
["Naval Special Warfare Command"] = {
["Regiment Name"] = "NSWC",
["Group Id"] = 32954415,
["Image Id"] = "http://www.roblox.com/asset/?id=15186922222",
["Regiment Color"] = Color3.new(0.129412, 0.129412, 0.129412),
["Minimum RankId"] = 5,
["Maximum RankId"] = 250,
},
}
return regiments
我试着拉下来,因为我认为这就是问题所在。但后来它只是没有返回任何值,只是给了我空白选项。local userRankInGroup = plr:GetRankInGroup(32494019)
if userRankInGroup and userRankInGroup >= division["Minimum RankId"] and userRankInGroup <= division["Maximum RankId"] then
答: 暂无答案
评论
ipairs
pairs
ipairs