Recent weapon
This commit is contained in:
parent
3a4e0f30bf
commit
f234ca974e
4 changed files with 15 additions and 1 deletions
|
|
@ -27,6 +27,7 @@ signal walk_begin
|
|||
signal walk_end
|
||||
signal interact_begin
|
||||
signal interact_end
|
||||
signal recent_weapon
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not is_multiplayer_authority(): return
|
||||
|
|
@ -110,6 +111,9 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||
|
||||
if event.is_action_pressed("plr_jump"):
|
||||
jump_on_server.rpc_id(1)
|
||||
|
||||
if event.is_action_pressed("plr_recent_weapon"):
|
||||
recent_weapon_on_server.rpc_id(1)
|
||||
|
||||
@rpc("authority","call_local","reliable")
|
||||
func switch_on_server(slot: StringName) -> void:
|
||||
|
|
@ -180,3 +184,8 @@ func interact_on_server(end: bool) -> void:
|
|||
func jump_on_server() -> void:
|
||||
if not multiplayer.is_server(): return
|
||||
jumped.emit()
|
||||
|
||||
@rpc("authority","call_local","reliable")
|
||||
func recent_weapon_on_server() -> void:
|
||||
if not multiplayer.is_server(): return
|
||||
recent_weapon.emit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue