So this may seem simple but I cant figure it out so you know you can make something happen while they are in the region how do you make it so when you exit something happens. For example game the iconic fencing game on Roblox when you enter you can do damage to others when you exit you cant.
local region = Region3.new(Vector3.new(1,1,1), Vector3.new(10,10,10))
local part =Instance.new("Part", game.Workspace)
part.Anchored = true
part.Size = region.Size
part.CFrame = region.CFrame
part.CanCollide = false
part.Transparency = 0.6
part.Color = Color3.new(1, 0, 0)
while true do
wait(1)
local partsInRegion = workspace:FindPartsInRegion3(region, part, 1000)
for i, v in pairs(partsInRegion) do
if v.Parent:FindFirstChild("Humanoid") then
print("Player in region", v.Parent)
game.ReplicatedStorage.ClassicSword.Parent = game.StarterPack
end
end
end
BTW I’m making sword go to replicated storage when exited region3.