Hi, this should be fixed now in the latest release!
Does this work with streaming enabled on?
Yep, as long as youâre waiting for the parts before constructing the zones(s) you should be perfectly fine!
local modelOfParts = workspace:WaitForChild("ZoneGroup")
local zone = Zone.new(modelOfParts)
Is there any easy way to allow humanoid dummies for the player entered/exited events or should I just use partentered
I may explore events such as .humanoidEntered
, .humanoidExited
, etc in the future, although for the time being youâll have to use .partEntered
and .partExited
events.
trying to use for loops with the zone on player enter but they donât appear to work. Initially I thought there were mistakes with my for loop but Iâve fixed them but I realized they donât even pass through the for loop to begin with. Does this module just completely ignore them?
edit: fixed
you may notice unnecessary variable like playertargetfar, i thought for some reason the return wasnât working but turns out the for loop is complete invisible.
When you say itâs not passing through the loops, is zone1.playerEntered
still firing at all or not? (i.e. is âentering printedâ)?
yea, entering and inside are printing, none of the iâs print
In theory with myself testing, it should print entering, all iâs and then the last elseifâs i and return.
ZonePlus simply provides the events, the functions you connect will work like any other roblox connection.
Itâs worth noting that if your #Queue
is less your start vale (i.e. 2) then nothing will print within the loop. You can learn more about loops here: Introduction to Scripting | Roblox Creator Documentation
youâre right, when I test print my dictionary I get 0 for some reason
local Queue = {
CP1Occupant = "",
CP2Occupant = "",
CP3Occupant = "",
CP4Occupant = "",
CP5Occupant = "",
CP6Occupant = "",
CP7Occupant = "",
CP8Occupant = "",
CP9Occupant = ""
}
#Queue should be == 9 but its not, looks like Ill have to manually enter
You can only call the length function (aka #
) on an array (i.e. a table with incrementing integers as keys).
You need to use a for pairs loop for a dictionary. I recommend #help-and-feedback:scripting-support for further help on that.
How can I use this to make a part not able to leave the zone?
If the partâs anchored, you can zone:findPart to check if itâs within the zone, e.g.:
game:GetService("RunService").Heartbeat:Connect(function()
local isWithinZone = zone:findPart(basePart)
if isWithinZone then
-- Move part
else
-- Don't move part
end
end)
Thanks! I am making a build mode with a freecam and I want to make it so the camera doesnât leave the plot.
how can i make partentered/partexited work with anchored parts? i need this for my tower defense game.
ZonePlus doesnât support anchored parts for non-players at this stage in time. Itâs something we may explore for the future.
okay, but i have one more question, does playerentered/playerexited work with npcs?
Not at this stage either, thatâs something weâll likely explore for the future:
okay, thanks anyway.
30 ch ars
Wow this is insane! Thanks a lot!!!