Synchronising Grenade in 3D Multiplayer

Godot Version

Godot 4


I am making a Multiplayer FPS game and i want to make a smoke grenade i have done most it but the part i am struggling with is making the grenade to appear on other players screen. any help would be awesome. my current code to instance the grenade is this:

@rpc(“any_peer”, “call_local”)
func grenade():
if stamina > 15:
stamina -= 15
var grenadee = gren.instantiate()
grenadee.global_transform = %target.global_transform
grenadee.linear_velocity = velocity
grenadee.apply_central_force(-camera.global_transform.basis.z * throw_force)

these errors come up whenever the grenade tries to spawn: “get_node: node not found: “/root/rigidBody3D/multiplayerSynchronizer” (absolute path attempted from “/root”)”

and after that the error: "get_cached_object:failed to get cached path: /root/RigidBody3D/MultiplayerSynchronizer

you need a MultiplayerSpawner in order for the object to be created by other players and a Multiplayer Synchronizer to synchronize its properties

sorry for not giving enough imformation but i have done that.