Why does one player hit for 9999?

Your host believed what the client told it.

Why does one player hit for 9999?

The problem

The client says how much.

[Rpc.Host]void RequestDamage( Enemy target, float amount ){    target.Health -= amount;} // on the clientRequestDamage( enemy, 9999 );

The host runs it, but the number came from the player. A modded client sends whatever it likes.

The fix

The client asks. The host decides.

Send only what the player did. The host works out the result from its own numbers.

client→"I fired at it"→host checks, host decides

The fix in code

The host uses its own numbers.

[Rpc.Host]void RequestShot( Enemy target ){    if ( !target.IsValid() ) return;     var d = WorldPosition.Distance( target.WorldPosition );    if ( d > Range ) return;     target.Health -= Damage;   // the host's own value}

Range and Damage are the host's own copies. Nothing the client sends can raise them.

Watch out

Check who's asking, too.

A host RPC can be called on any networked object, not only the caller's own.

Rpc.Caller
who sent it, can't be faked
Network.Owner
who owns this object
Not the same?
refuse it

The rule

Clients ask. The host decides.

Client sends
what it did
Host checks
range, target, caller
Host uses
its own numbers