【发布时间】:2021-01-13 03:45:10
【问题描述】:
我正在开发一款角色扮演游戏,玩家必须在特定工作中安装散热器。现在我只希望管道工能够安装散热器,因此我在一个物品放置系统上工作。我目前面临的唯一问题是,即使我在正确的团队中,它仍然无法检测到我是正确的人。 这是使用的相关完整脚本。
script.Parent.Event.OnServerEvent:connect(function(player)
if player.Team == game.Teams.Haustechniker then
local backpack = player:WaitForChild("Backpack")
local character = player.Character or player.CharacterAdded:Wait()
local function purgeLaunchers(container)
for _, item in pairs(container:GetChildren()) do
if item:IsA("Tool") and item.Name:match("Abdeckvlies") then
item:Destroy()
script.Parent.Part.Transparency = 0
script.Parent.Event:Destroy()
script.Parent.Text:Destroy()
script.Parent.Range:Destroy()
end
end
end
purgeLaunchers(backpack)
purgeLaunchers(character)
end
结束)
【问题讨论】: