📜  检查玩家的区域 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:37.147000             🧑  作者: Mango

代码示例1
local Part = script.Parent
Part.Touched:Connect(function() end) -- Just for a TouchInterest to occur on a CanCollide false part

function CheckIfPlayerIsInArea(Part,Character)
    local touching = Part:GetTouchingParts()
    for i=1,#touching do
        if touching[i] == Character.HumanoidRootPart then
            return true
        end
    end
    return false
end