For i,v in pairs() not working

The issue here is that the client does not have a part not indexing the pairs loop doesn’t start because the table is empty even though there are Instances in the zones Instance so I am trying to figure out how to replicate it or why is it deleting / not synching with the server right Roblox made StramingEnabled enabled as default I am trying to test that

The issue is not in the for loop; it’s in local Zones = workspace.SoundsRegions. You’ve shown that a folder with that name exists, but there’s nothing in it. Can you check what’s inside while running the script? Possibly something is deleting the parts inside.

For that, you can just replace it with:

local Zones = workspace.SoundsRegions:GetChildren()
--"Zones" is now a table of children.

if #Zones > 0 then
    print("not empty")
else
    print("empty")
end

even that doesnt work btw
roblox limit

He already sent what’s in that folder

Please read this thread before responding

it doesnt delete anything the parts still here,
image

You’re using zoneplus yes?

Are you trying to delete the children in this folder?
You don’t need to use a for parameter, you can very easily do this:

Zones:ClearAllChildren()
--removes all children

yes,
roblox limit limit limitlimit limit limit

Then why not use the built in function in the API?
.getZones() ZoneController - ZonePlus

how do i use it?
robloxlimitlimit

for _,v in ZoneController.getZones() do
	print(v) -- your zones are  here
end

Yeah, so if you want to remove all children, you don’t need a for parameter. I just solved your problem.

ZoneController:ClearAllChildren()

no,
that is not what i need to do

Did you read the original post? He’s not trying to delete all the children; he’s trying to create zones from the parts in a folder.

Also, @weakroblox35, that will do nothing because no zones are being created.

Play your game and send a screenshot of the workspace.

1 Like

Like this?

local RegionTextGui = script:WaitForChild("RegionText")
local RS = game:GetService("ReplicatedStorage")
local Skies = RS:WaitForChild("Skies")

local TweenService = game:GetService("TweenService")

local plr = game:GetService("Players").LocalPlayer
local PlayingSong = game:GetService("SoundService").PlayingSong

local ZonePlus = require(game:GetService("ReplicatedStorage").Modules.Zone)
local ZoneController = require(game:GetService("ReplicatedStorage").Modules.Zone.ZoneController)

local Zones = workspace:WaitForChild("SoundsRegions"):GetChildren()

for _, zone_part in ZoneController.getZones() do
	print(Zones)
	local trigger = ZonePlus.new(zone_part)
	trigger.playerEntered:Connect(function(player)
		if player == plr then
			TweenService:Create(PlayingSong, TweenInfo.new(.75), {Volume = 0}):Play()
			wait(.75)
			PlayingSong.SoundId = zone_part.Sound.SoundId
			local nextVolume = zone_part.Sound.Volume
			TweenService:Create(PlayingSong, TweenInfo.new(.5), {Volume = nextVolume}):Play()
		end
	end)
end

ZoneController.setGroup("SoundRegions", {
	onlyEnterOnceExitedAll = true;
})

That could be easily solved if OP read the docs. Method - ZonePlus

Yeah you can try that.

ok, it didnt work
limitlimitlimitlimit

Last bet is to read the API’s docs, or use functions in the resource.

no but the thing is, i literally use this script for my other games, and it works perfectly fine