-
What do you want to achieve? Use of playerEntered and Exited events
-
What is the issue? The events are not firing at all. All the print statements in my code below run as well. Except for the print statements that print when they enter or exit.
-
What solutions have you tried so far? I have tried checking if the zonesplus module works on another game. And yes, it does work.
Details: safeZone is the name of a model that gets cloned from a map in replicated storage to the workspace when each map is cloned.
local function process(v)
local zone = Zone.new(v)
print("processing")
zone.playerEntered:Connect(function(player)
print("player entered")
end)
zone.playerExited:Connect(function(player)
print(("%s exited the zone!"):format(player.Name))
end)
for _, v in game.workspace.GameSystem:GetDescendants() do
if v.Name == "safeZone" then
process(v)
end
end
game.workspace.GameSystem.DescendantAdded:Connect(function(v)
if v.Name == "safeZone" then
print("processed")
process(v)
end
end)
Could someone help playerEntered and exited wont fire, and there are no errors in the output as well??