Jump to content

Cant seem to get this Lua to fire and Print(); not showing in console.


That Homeless Guy

Recommended Posts

I have started modding PZ and I was experimenting with key registry trying to figure out which keys are what by printing them in the console. This failed to print keys to console so I tried spawning something to the players inventory (something I've done before)
I have searched and found no info on left click behaviour or detecting it.
But this piece of code just doesn't work and through testing Print(); doesn't work in code that does work.

The sub directory for this file is media\lua
I have also tried media\lua\server and media\lua\client.
 

TTG_Click = {};TTG_Click.characterInfo = nil;TTG_Click.click = function(_keyPressed)    local player = getSpecificPlayer(0);    local key = _keyPressed;     player:getInventory():AddItem("Base.Pistol");    print(key);endEvents.OnKeyPressed.Add(TTG_Click.click);

Any Ideas on what's gone wrong? The file is called TTG_Click.lua


Edit: Thank you for moving me I was on the help sub forum for mods when I clicked start new topic don't know how it ended up there.


Requesting a mod remove this thread. I never found out what the issue was but I was directed to a completely different solution and implementation.

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...