I mean… how you can use zonecontroller.getGroup()
properly?
Not sure if anybody will find this useful, however I edited the “LightingZone” script in the StarterPlayerScripts to allow you to use the Module with Atmosphere!
I’m not a scripter, and really only have the most basic of understandings, but if anybody wanted it, here you go:
local Zone = require(game:GetService("ReplicatedStorage").Zone)
local lightingAreas = workspace.LightingAreas
local lighting = game.Lighting.Atmosphere
local tweenService = game:GetService("TweenService")
-- This is our default lighting
local defaultLighting = {
Density = 0,
Offset = 0,
Color = Color3.fromRGB(0,0,0),
Decay = Color3.fromRGB(0,0,0),
Glare = 0,
Haze = 0,
}
--
lightingAreas:WaitForChild("Green", math.huge)
task.wait()
--
for _, container in pairs(lightingAreas:GetChildren()) do
-- Construct the lighting zones and bind them to the same group to ensure that the localPlayer only enters one zone at a time
local zone = Zone.new(container)
zone:bindToGroup("EnterOnlyOneZoneAtATime")
-- This is our zone lighting
local zoneLighting = {
Density = 0.423,
Offset = 0.254,
Color = Color3.fromRGB(126,126,126),
Decay = Color3.fromRGB(0,33,179),
Glare = 0.56,
Haze = 3.1,
}
-- This is called when the localPlayer enters the zone
zone.localPlayerEntered:Connect(function()
tweenService:Create(lighting, TweenInfo.new(0.5), zoneLighting):Play()
end)
-- This is called when the localPlayer exits the zone
zone.localPlayerExited:Connect(function()
tweenService:Create(lighting, TweenInfo.new(0.5), defaultLighting):Play()
end)
end
I’m sure there’s a better way I could have done this, however, simply changing this code is about the extent to my scripting knowledge.
Thank you so much for providing the community this Module ForeverHD!
Hi guys, I wonder if there is any way to make an “Event” (For example, changing the atmosphere), to players that ARE already inside a zone? Like, the guys are playing and are in the zone, something random happens with the atmosphere and the people inside this zone are infected with it.
This is posted above:
Lord_BradyRocks
zone:findPlayer()
is what you need.
1 Reply
Reply
Lord_BradyRocksGame Designer
LordMerc
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?
I cannot rem if I ever got it to work tho…
But if you do, when the event happens, you could loop through the players in the game and see if they are in the zone… and or you could be building a table when they enter and exit and then just read the table when the event happens
If you get it working, can you send me a msg with how you did it?
thanks
most common foreverhd W thanks again
How I use the local isWithinZoneBool = Zone:findLocalPlayer()
?
I’m having problems with inconsistent behaviour when players reset or die.
Using .playerEntered in a LocalScript placed in StarterPlayerScripts, it often does not call the function after resetting, but sometimes does, hence being inconsistent.
Show script and show where it is located.
Is there a good way to use this to restrict players from entering the zone conditionally? I realize I can just teleport them, but that will not be natural looking for zones meant to just have a blockade. I don’t see a point of entry part of the zoneplus api which would be nice to just bump them back before they entered. Perhaps need to add that feature myself, but curious how others are handling it.
zone around a zone, outer zone on touch looks for condition , if met turn can collide off
not bad, but won’t that not work if a player that does not meet the condition enters right after the player that did have it. It would then block the player that was supposed to be able to pass. I think we still need to mess with collision groups.
it would be a local client script that only allows the player
sure but I guess if I am also going to be trying to prevent exploits then it is better to also still push the player out of the zone if they don’t meet the condition.
post what your requirements are to enter… like if they have a tool, or key or something, and I will play around to make it…
your condition is so mysterious … like a badge… a leaderstats level… etc…
thanks…got it working. Appreciate it. I ended up doing like you suggested but to prevent exploits server also checks condition on enter an teleports them out if needed.
Sorry for bumping, have a question: is there a command to get an existing zone? Or will that be added in the future?
Please elaborate on ‘command’? This isn’t an admin system.
Scroll up about 10 posts…and the command to check what zone a player is in is there
Unfortunately there isnt an API/command to get an existing zone from a part.
if there is, please tell me.
After morphing into a custom character playerEntered wont work. any reason as to why?