[HELP NEEDED] Checking needs of prisoners.

Discussion about Mods for Prison Architect

Moderator: NBJeff

User avatar
Posts: 38
Joined: Tue Dec 24, 2013 10:52 pm
Location: The Czech Republic

[HELP NEEDED] Checking needs of prisoners.

Postby Alpatron » Fri Mar 31, 2017 6:17 pm

So, I've been modifying a mod (this one). My goal is that when a drug or alcohol addicted prisoner is near the sensor that the prisoners security level will be changed.
The problem is that the script refuses to work and refuses to read the needs of the prisoners.
The game throws at me this error.

Code: Select all

local prisoners = Object.GetNearbyObjects(this, "Prisoner", 10);
if prisoners~=nil then
   for name,dist in pairs( prisoners ) do
      if (name.Needs.Drugs~=nil or name.Needs.Alcohol~=nil) and name.Category~='DeathRow' then

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest