Return 被忽略
Return is getting ignored
因为我想制作一个脚本让 RemoteEvent 只触发特定组中的用户,所以我遇到了一个错误
即使我不在群里,即使不允许,它仍然继续发射服务器
所以“其他”被忽略了
if player:IsInGroup(7503826) or (7467047) then
print("InGroup")
else
warn("Not in Intelligence Agency, Either in Internal Security Department")
return
end
我做了一个 pcall 函数来检查它是成功还是失败
local success, message = pcall(player, PlayerToBlind)
if success then
print("Success")
else
print("Failed")
end
它总是给我打印“失败”
任何修复?
您的条件将始终 return 正确。应该是
if player:IsInGroup(7503826) or player:IsInGroup(7467047) then
(7467047)
单独作为表达式将始终为真。
因为我想制作一个脚本让 RemoteEvent 只触发特定组中的用户,所以我遇到了一个错误
即使我不在群里,即使不允许,它仍然继续发射服务器 所以“其他”被忽略了
if player:IsInGroup(7503826) or (7467047) then
print("InGroup")
else
warn("Not in Intelligence Agency, Either in Internal Security Department")
return
end
我做了一个 pcall 函数来检查它是成功还是失败
local success, message = pcall(player, PlayerToBlind)
if success then
print("Success")
else
print("Failed")
end
它总是给我打印“失败”
任何修复?
您的条件将始终 return 正确。应该是
if player:IsInGroup(7503826) or player:IsInGroup(7467047) then
(7467047)
单独作为表达式将始终为真。