Hi, currently I know how to detect when a part enters a certain part but I don't know how to detect when it leaves that exact part? Help is appreciated
--/ block selection
local currentblock
local table1 = {}
while wait(1) do
local noerror,errormsg = pcall(function()
--/ update list
for i,v in pairs(game.Workspace.SelectTest:GetChildren()) do
if not v:FindFirstChild("Selection") == nil then
print("OK")
table.insert(table1,v)
end
end
local mouseraycast = mouse.Target
if mouseraycast then
if mouseraycast.Parent.Parent == game.Workspace.SelectTest then
currentblock = mouseraycast
--/ clone our glow to the block
local glow = replicatedstorage.MechanicEffects.SelectEffect:Clone()
glow.Name = "Selection"
glow.CFrame = currentblock.CFrame
glow.Parent = currentblock.Parent
elseif mouseraycast == currentblock then
print("okay")
end
end
end)
--/ catch any errors so it doesnt stop our script
if errormsg then
warn(errormsg)
end
end

1 comment
if mouse.Target.Name ~= "part" then end