1. how do i get when the player is taking damage?
2. how do i fix so the player don't shoot while running/sprinting
3. how do i get what the player is shooting?
i need help with some things!
Forum rules
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
- Lovatto
- Admin
- Posts: 1834
- Joined: Sun Dec 07, 2014 3:18 pm
- Contact:
Hi,
1. There is not an event for this, but you can easily one:
add this code in bl_EventHandler.cs:
Then in bl_PlayerHealthManager.cs -> SyncDamage(...) -> add this line:
inside this :
Now you can subscribe to the bl_EventHandler.onlocalPlayerReceiveDamage
to know when the local player gets hit.
2. Turn off the option in GameData -> Can Fire While Running.
3. You can subscribe to the event: bl_EventHandler.onLocalPlayerFire
Regards.
1. There is not an event for this, but you can easily one:
add this code in bl_EventHandler.cs:
Code: Select all
public static Action<int> onlocalPlayerReceiveDamage;
public static void DispatchLocalPlayerReceiveDamage(int damage) => onlocalPlayerReceiveDamage?.Invoke(damage);
Code: Select all
bl_EventHandler.DispatchLocalPlayerReceiveDamage(damage);
Code: Select all
if (DamageEnabled)
{
if (health >= 0)
{
if (isMine)
{
/// ADD LINE HERE
to know when the local player gets hit.
2. Turn off the option in GameData -> Can Fire While Running.
3. You can subscribe to the event: bl_EventHandler.onLocalPlayerFire
Regards.
- Luddeisbad
- Contributor
- Posts: 11
- Joined: Sat Sep 11, 2021 9:57 pm
Thanks!
What i meant with the 3rd one was how do i get what the bullet hit
What i meant with the 3rd one was how do i get what the bullet hit