@ForeverHD Do you think it would be possible to get rid of most dependencies in the future? I think it would be beneficial for most of us, thank you :)!
By dependencies are you referring to these?
You wouldnât want to remove these as theyâre essential to the running of ZonePlus. ZoneController for instance handles the spatial-checking logic while Janitor helps with the tracking and cleaning of objects.
Okay I understand you, but would it be possible to give us option to place the modules elsewhere? For example by referencing them with Object Values?
Whatâs your use case for this?
You can quickly modify the location of dependencies by searching script.
within the Zone
and ZoneController
modules and modifying the 5 lines at the top:
I know but doing it each time you update it is kinda âtime consumingâ :D.
Would it be possible if you can add something like this to the original code?
local Signal = if script.Parent:FindFirstChild("Reference_Signal") then require(script.Parent:FindFirstChild("Reference_Signal").Value) else require(script.Parent.Signal)
Or I can probably just use :FindFirstChild("...",true)
instead, thanks for the replying to me tho :)!
I could certainly add a variable for script.Parent
to help speed this up. For your very specific use-case it wouldnât make sense to bloat the module for something which can be modified in a few seconds.
Iâm having an issue with a zone. Does it fire partExited
if a part inside gets destroyed? I couldnât find any examples or replies on this.
Yes, even if the part is destroyed or teleported it will still fire the exited signal
Thanks for the reply, but it didnât end up firing. I got around it by tracking the part when it enters, then using the itemExited
event to see when it exited.
Good spot, just tested now and it doesnât appear to be functioning for the part
events. Youâre right in using the player
or item
events partially instead for the time being which do detect exited
as intended. Iâve opened up a ticket for that here:
How do I check if a zone exists?
What do you mean exactly by that? Like if itâs already defined orâŚ?
How can i make in each zone appear something different in a gui
this is what happen to me
when i enter a zone it appears me in the gui but when i go to the other zone it doesnt.
my code:
local Zone = require(game:GetService("ReplicatedStorage").Zone)
local Test1 = workspace.RepublicaMexicanaColliders.Yucatan
local test1 = Zone.new(Test1)
local Test2 = workspace.RepublicaMexicanaColliders.Quintanaroo
local test2 = Zone.new(Test2)
test1.playerEntered:Connect(function(player)
player.PlayerGui.EstadoDisplay.Frame.Textura.Estado.Text = ("name:".."Test1")
player.PlayerGui.EstadoDisplay.Frame.Textura.Capital.Text = ("name:".."Test1")
wait(0.5)
end)
test1.playerExited:Connect(function(player)
player.PlayerGui.EstadoDisplay.Frame.Textura.Estado.Text = "you are not in a place"
player.PlayerGui.EstadoDisplay.Frame.Textura.Capital.Text = "you are not in a place"
wait(0.5)
end)
test2.playerEntered:Connect(function(player)
player.PlayerGui.EstadoDisplay.Frame.Textura.Estado.Text = ("name:".."Test2")
player.PlayerGui.EstadoDisplay.Frame.Textura.Capital.Text = ("name:".."Test2")
wait(0.5)
end)
test2.playerExited:Connect(function(player)
player.PlayerGui.EstadoDisplay.Frame.Textura.Estado.Text = "you are not in a place"
player.PlayerGui.EstadoDisplay.Frame.Textura.Capital.Text = "you are not in a place"
wait(0.5)
end)
Not defined, I want to find if there is any existing zones.
What are you referencing zonecontroller as�
How would I print the zone name that the player is in?
local Zone = require(game:GetService("ReplicatedStorage").Zone)
local container = workspace.SafeZoneGroup
local zone = Zone.new(container)
zone.playerEntered:Connect(function(player)
print(("player '%s' entered zone '%s'!"):format(player.Name, zone.name))
end)
zone.playerExited:Connect(function(player)
print(("player '%s' entered zone '%s'!"):format(player.Name, zone.name))
end)
Simply define whatever name you like:
zone.name = "AVeryCoolZone"
For your code that looks like:
local Zone = require(game:GetService("ReplicatedStorage").Zone)
local container = workspace.SafeZoneGroup
local zone = Zone.new(container)
zone.name = "AVeryCoolName"
zone.playerEntered:Connect(function(player)
print(("player '%s' entered zone '%s'!"):format(player.Name, zone.name))
end)
zone.playerExited:Connect(function(player)
print(("player '%s' entered zone '%s'!"):format(player.Name, zone.name))
end)
ok, but what if I have more than one safezone like below?
The code would still be the same as what he just posted.