Trying to make a safezone for my game, using a region for the safezone and a region for the world itself. Whichever function I put first is the only one that runs. Can someone help me with this or give me a better method of doing it?
while JB do
wait(0.5)
local partsInJB = workspace:FindPartsInRegion3(jbRegion)
for i, part in pairs(partsInJB) do
if part.Parent:FindFirstChild("Humanoid") ~= nil then
player = game.Players:GetPlayerFromCharacter(part.Parent)
char = player.Character
currentZone = "Jame's Bay"
print(player.Name.." found in JB")
newGui(player,currentZone)
end
end
end
while world do
wait(0.5)
local partsInWorld = workspace:FindPartsInRegion3(worldReg)
for i, partw in pairs(partsInWorld) do
if partw.Parent:FindFirstChild("Humanoid") ~= nil then
player = game.Players:GetPlayerFromCharacter(partw.Parent)
chawr = player.Character
currentZone = "Leaving SafeZone..."
print(player.Name.." is leaving the SZ")
newGui(player,currentZone)
end
end
end

1 comment
Put the "while world do" and everything below it in a seperate script maybe? It's stuck on the first loop.