xxxxxxxxxx
local RunService = game:GetService("RunService")
local part = (path to your part here)
local touchingTable = {}
RunService.Stepped:Connect(function()
touchingTable = part:GetTouchingParts()
wait()
end)
game.Players.PlayerRemoving:Connect(function(player)
print(player.Name.." left the game")
for i,v in pairs(touchingTable) do
if i == player.Name then
print(player.Name.." left whilst touching part")
end
end
end)