thelegacy0 Posted April 4, 2014 Share Posted April 4, 2014 (edited) I'm using multiple classes and I'm struggle with every class using the client and player. Things like client.getMyPlayer() Return null in anything besides my one class. How can I make it so both classes after access to stuff like client.getMyPlayer() and client.moveCameraToEntinty() Without having to write method(Player p) p.getInfo(); Both classes import and extend script. I just want both classes to be able to use client.getMyPlayer(); Answer: see below TWO posts Edited April 4, 2014 by thelegacy0 Link to comment Share on other sites More sharing options...
Extreme Scripts Posted April 4, 2014 Share Posted April 4, 2014 Your not suppose to extend script for each of your classes, your suppose to create a constructor which extends method provider, you could do it like so: This will then allow you to access the MethodProvider using "s.client.blah blah" Hope that's clear enough for you 1 Link to comment Share on other sites More sharing options...
Pandemic Posted April 4, 2014 Share Posted April 4, 2014 In your constructors of your other classes, include your main class as a parameter (like this): Main Class: SecondClass secondClass = new SecondClass(this); SecondClass: private MainClass class; public SecondClass(MainClass script) { this.script = script; } 1 Link to comment Share on other sites More sharing options...
thelegacy0 Posted April 4, 2014 Author Share Posted April 4, 2014 Thank you guys, adding (this) to my main class and this.s = s; plus s.client did the trick! Divinity, how do you get your pictures that size? Mine come up microscopic Link to comment Share on other sites More sharing options...