This is great! thank you so much! I will be using this to create different music areas.
Hey, just wondering: can I create mobile zones with this module? Like, let’s say I weld a part that acts as hitbox to a player and then create a zone by using that same part.
If the player starts walking, will the zone move too with the welded part?
I don’t want this, how do I make it so they can die and spawn in the same zone without it ever registering? A zone is a new area with an area name popup and other effects. If they die and then respawn in the same zone it shouldn’t be considered a new area and those effects shouldn’t be triggered.
I seemed to have fixed it with this. I’m a little confused why the second return works, but I’m not complaining.
Hi,
Does anyone know the script to see what zone or part the player is currently in?
Like I want to run a script that will tell me if the player is currently in PartA / ZoneA.
From what I have seen, most things are triggered events , enter , exit…
Thanks for any help!
zone:findPlayer()
is what you need.
What is there are 2 zones they are in, meaning there is an overlapping zones and they could be in 2 at the same time? Does zone:findPlayer()
return multiple zones?
Anyone know how to already detect a player in a zone when they spawn in. Like a safe zone. The player spawns in the lobby and the safe zone is in the lobby but it doesn’t change their gui which I want it to.
Does not change what player gui? The ‘safe zone circle around you effect thinga ma thing’ ?
His demo game EDITable has I safe zone in it…
OOps, forgot this still existed. Sorry, I figured out the problem! Thank you so much for your time and help though.
Your modules are such a simple idea but are always SO helpful! Thank you for this!
Hi i tried making a while loop when u enter the zone but i couldnt make it to stop with exit. do u have any idea how can i make that work? i tried number and bool values from character but they didnt work. and i tried things like while _G.active == true do
but they didnt worked. And yes i did change the values before the loop and at the exit script. i also tried some stuff with Zone:FindPlayer but they also didnt worked.
how can i make a loop work only if player is in the zone. as a server script.
Run the loop when they enter the zone with a if true condition (if they are in the zone, do it)
this is the script im using
zone.playerEntered:Connect(function(player)
print("player has entered the zone")
local isWithinZoneBool = icebath:findPlayer(player)
local health = game.Workspace:WaitForChild(player.Name).Humanoid
local debounce = game.Workspace[player.Name].bt.icebath
debounce = 0
if debounce == 0 and isWithinZoneBool then repeat
health.Health -= 15
debounce = 1
wait(1)
debounce = 0
until not isWithinZoneBool
end
end)
and its not ending the loop when player exits
Hey there, the reason that’s happening is because zone:findPlayer()
is always true since it’s only being checked once upon player entrance and not throughout the loop.
This works:
zone.playerEntered:Connect(function(player)
print("player has entered the zone")
local health = player.Character.Humanoid
local debounce = true
if debounce and icebath:findPlayer(player) then repeat
player.Character.Humanoid.Health -= 15
debounce = false
wait(1)
debounce = true
until not icebath:findPlayer(player)
end
end)
I don’t know why you are checking a seperate zone named icebath though, do you have a zone within a zone? Also I’d advise against using repeat until.
icebath is name of the model which has the zone seperately and the parts in it separately.
I was also wondering this, I do not think so but I hope there is a way.
OH I actually ended up testing it for myself and yes it does! The zone can be moved at runtime.
Hey, I have a zone made of an array consisting of baseparts. Problem is, I keep getting a exhausted execution time error when I try to get a random point.
Is this normal?
EDIT: My bad, I had a framework which destroyed the parts with no collisions on.
Zone not working sometimes when I clone it from ServerStorage to workspace. It works 50/50 and sometimes not working for no reason. No errors in output. It create zone but playerEntered event not working.