local hitbox = script.Parent.magicForestHitbox
while wait() do
local players = game.Players:GetPlayers()
local region = Region3.new(hitbox.Position - (hitbox.Size/2), hitbox.Position + (hitbox.Size/2))
local parts = game.Workspace:FindPartsInRegion3(region)
for i, v in pairs(parts) do
if v.Name == "HumanoidRootPart" then
if v.Parent:FindFirstChild("Human") then
--call remote event with v.parent.name
print("player found")
plr = table.find(players, v.Parent.Name)
table.remove(players, plr)
end
end
end
for i, player in pairs(players) do
print("Player not in region3")
--call remote event to stop music
end
end
For some reason, it decides sometimes I’m in the region, sometimes I’m not. When it isn’t supposed to. The region is the correct size, I’ve verified that, so I have no idea what’s going on? No errors or anything, either, just when I 'm in the region3 it starts to sometimes say I’m in it and sometimes out of it.