Jump to content

Recommended Posts

Posted

I'm looking to store a variable to be used in a player tick event for each player.

For example say I want the float 'distance' as a variable my tick event can access, but I want there to be a different instance of 'distance' for each player.

 

This is asuming player tick event fires for each player, which I now realise it may not.

 

Is there anyway to achieve this? I'd rather not use capabilities to store this as it's a really simple variable.

Thanks for your help!

 

Posted (edited)

I'm afraid player capability is the only way to achieve this afaik. It is not as simple as storing the data in the fields in your event class (which won't work), but it is the only way I can think of. Also it is not so complicated isn't it?

Edited by poopoodice
  • Like 1
Posted
3 minutes ago, poopoodice said:

not so complicated isn't it?

It's not I was just seeing if I could fit an entire mod in one class for fun ;)

I guess not, thanks for the help!

  • Haha 1
Posted (edited)
5 minutes ago, squidlex said:

It's not I was just seeing if I could fit an entire mod in one class for fun ;)

Interesting haha

Edit: I misread your post.

Edited by poopoodice
Posted (edited)
4 minutes ago, poopoodice said:

inner class count as a "class" for you?

You know what I completely forgot I could do that! Time to try this again haha thanks man :)

(I'm very tired)

Edited by squidlex

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.