But for some reason, I can't do %client.player. Every time I do, it returns nothing.
Because you're trying to reference the player before it's been created.
parent::spawnPlayer(%this); will call the original version of the code, which is what is creating the player. You need that line before the rest of the code
Edit: I'm also wondering how I'd go about making a player faster while in midair-- air control, basically. You'd walk the normal speeds on ground, but really fast in the air. I have no idea how to approach this, and if the answer is really convoluted then just tell me so.
There's a preexisting datablock field for this, I don't remember the name. .dump a playertype datablock and look around, or I'm pretty sure there's a playertype that already does this that you could look at.
Edit 2: I was working and trying to set up a system so when you hold your light key, your maxForwardSpeed is increased. I couldn't figure out how to do that, since it was a dash between useLight which tells you when it is being pressed and isn't, and servercmdLight which allows you to access the client. So, I thought of the next best thing, schedules. Even through extensive searching, I'm still not quite sure how to format them. Here's my try at it:
This can't be done without a client-side add-on.
useLight is a client-side function, you can't make server-side add-ons referencing it because they'll only work for the host of a listen server
schedule(5000, 0, evalSlowDown, %client);
function evalSlowDown(%client)
{
%client.player.setmaxForwardSpeed(20);
}[/tt]
This can be replaced with
%client.player.schedule(5000,setmaxForwardSpeed,20);