canEnter
Description
Triggered when a player attempts to enter a property through the pre-check callback flow.
This is executed from nolag_properties:server:property:canEnter, which runs before shell/IPL enter transition logic.
Payload Structure
lua{ source = playerId, -- The player's server ID propertyId = propertyId, -- Property identifier propertyType = type, -- Property type: 'shell', 'ipl', or 'mlo' owner = ownerIdentifier, -- Current property owner identifier ownerType = ownerType, -- Owner type: 'user' or 'society' property = propertyObj -- ServerProperty instance }
Parameters
- source (number): The server ID of the player trying to enter
- propertyId (string/number): Unique identifier of the target property
- propertyType (string): Type of property (
shell,ipl,mlo) - owner (string): Current owner identifier
- ownerType (string): Ownership context (
userorsociety) - property (table): ServerProperty object for advanced checks
Usage Example
luaexports.nolag_properties:registerHook('canEnter', function(data) if data.propertyType ~= 'shell' and data.propertyType ~= 'ipl' then return true end if not canPlayerEnterProperty(data.source, data.propertyId) then return false -- Cancel enter before transition starts end return true end)
Return Values
- true or nil: Allow enter to continue
- false: Cancel player enter flow