Jump to content

The code does not work on servers, any ideas?


Alanor Miga

Recommended Posts

So this is a code for a "burst-type" gun, what it does is that it stops the onKeyPressed (holding) after a couple of ticks, effectively making a burst-like click.

https://paste.gg/p/anonymous/e2996b28a8dd4c4287393e86bf48572a

I was told that the error is that the server does not what player to reference so it just dies and crashes the server

 

 

Link to comment
Share on other sites

2 hours ago, Luis_ST said:

you need to add the Dist to the EventBusSubscriber via the 'value' and set it to Dist.CLIENT

Ayye! Works almost like a charm! It does not crash, however, none of the postShoot/preShoot events trigger, these are in charge of making the shooting sound and spending ammo upon shooting.

Log be here:


https://paste.gg/p/anonymous/e8f630c32007453cbd86b0cf65a22a7c

Back to the drawing board it goes!

Link to comment
Share on other sites

40 minutes ago, Alanor Miga said:

do not post code for other here, you can permalink them on github, for example:
this

these Events are server and client side or server side only (im not 100% sure),
but this means you can't put them into a Client side EventHandler class, move them to a new/other EventHandler

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.