📅  最后修改于: 2022-03-11 14:57:58.491000             🧑  作者: Mango
local Players = game:GetService("Players")
local TouchPart = workspace["Part"] -- assign a part to it
TouchPart.Touched:Connect(function(touched)
if touched.Parent:IsA("Model") and touched.Parent:FindFirstChild("Humanoid") then
local Player = Players:GetPlayerFromCharacter(touched.Parent)
if Player then
-- do something here
end
end
end)