Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Damage Players Using Raycast

$
0
0
How could I make this function work correctly? So my players set a username and on Start, it will set their GameObject name as that name. I want to have a Raycast send this: nView.RPC("DamagePlayer", RPCMode.All, hit.transform.root.gameObject.name, ClientControls.mashCount + weapon.meleeDamage); And then that runs this RPC @RPC function DamagePlayer (ign : String, amount : float) { if(gameObject.name == ign){ GUISurvival.playerAttributes.currentHealth -= amount; } } So this should run for everyone, but if the username is the one I hit it should take damage, correct? Why isn't this working?

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>