I'm just now learning about Region3's because I think it's good for what I'm trying to do. I basically am trying to make a safe zone, where players inside the region will have a ForceField and players outside of it will not. I have found out how to make players inside it have a ForceField, but I'm not sure how to make their ForceField go away when they leave the region. Any help?
local part = script.Parent
local region = Region3.new(part.Position - (part.Size / 2), part.Position + (part.Size / 2))
while true do
local partsinregion = workspace:FindPartsInRegion3(region, part)
for _, part in pairs(partsinregion) do
if part.Parent:FindFirstChild("Humanoid") then
print("part belongs to player")
if not part.Parent:FindFirstChild("ForceField") then
local forcefield = Instance.new("ForceField")
forcefield.Parent = part.Parent
end
end
end
wait()
end
Update: I just tried using the TouchEnded function but it did not work sadly!
