To put it bluntly, the code Mexican provided is completely and utterly worthless. You don’t implement stuff by “converting it” between languages.
You should start by first implementing the SERVICE object in Lua, inside of your copy of the Cinema Gamemode’s code. You do this by making a new .lua file in
that follows the format of
, just like all of the other services that already exist in there. For example,
It is at this point that you’ll have to reference the other services to figure out how to make the service object itself, written in the file you just created. I’m not going to go over that here, because if you look at one of the services and you have any idea what you’re doing, you’ll be able to figure it out rather easily.
Once you’re done with the service object and you’ve registered it with Cinema’s Service System, by using
as seen in the other services, you’ll be ready to try and queue a video from that service. Assuming you’ve written your service correctly, requesting a video URL from that video service’s website will result in anything but “Invalid video request.” If nothing shows up at all, then you probably have your pattern matching wrong in your service’s
Assuming Cinema is able to get all the information it needs from the video service’s API (title, duration, etc), then you should be greeted in-game with an error on the theater screen that says “Video type not yet implemented.” If the screen doesn’t change at all/if the video didn’t queue successfully, go back and fix whatever is wrong with the SERVICE object.
and then restarting your server.
Once you’ve done that, it’s probably a good idea to change the script link for
in your repository. We want to do this temporarily because modifying the non-minified theater.js is a lot easier than modifying the minified one.
Now you can start implementing your new video service in theater.js. I’m not going to go over how to do this part either since it should become relatively apparently how a video service there should be implemented by referencing the other ones already there.
Also it will probably be beneficial for you to run
Also apparently in-line code blocks aren’t supported on Facepunch Forums, so pardon my rather poorly formatted post.