How can I see if a player is Inside of zone using heartbeat service?

I suggest using ZonePlus which is an excellent resource.

local Zone = require(game:GetService("ReplicatedStorage").Zone)
local container = workspace.AModelOfPartsRepresentingTheZone -- The Part which represents the zone.
local zone = Zone.new(container)

zone.playerEntered:Connect(function(player)
    print(`Player {player.Name} entered the zone`)
end)

zone.playerExited:Connect(function(player)
    print(`Player {player.Name} exited the zone`)
end)
1 Like