Jump to content

Trying to auto-play VHS tapes in a mod script


krem

Recommended Posts

I have a mod that successfully finds online players, searches objects within 10 tiles square for a television, detects the two test televisions I have in front of me, and allows me to call methods on those objects to detect whether they are powered on and playing media or not. It all works so far. I am just having trouble making that object play the VHS inside it. Tape is inside, tv is on, power is on.

 

I try to use the detected instance of IsoTelevision, specifically I try to make it play the VHS inside it using this method:

object:StartPlayMedia()

 

But I get the error I get when methods don't exist as-called:

Object tried to call nil in playVHSOnTelevision at KahluaUtil.fail line:82

 

It gets all the way to the point where it tries to play the VHS but that error comes up. I know I am doing something wrong, but can anybody give me advice?

Should I be using getDeviceData then modifying the data and passing it back with setDeviceData instead of what I am doing?

 

 

zomboid-vhs.lua log.txt

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...