Shop
This commit is contained in:
parent
06c5fea9bd
commit
cd20f952ce
6 changed files with 116 additions and 68 deletions
|
|
@ -7,9 +7,10 @@ func _ready() -> void:
|
|||
text = str(weapon.cost)
|
||||
|
||||
func _pressed() -> void:
|
||||
var player_data = Session.get_player_data()
|
||||
if player_data["money"] >= weapon.cost:
|
||||
var player: Player = Session.player_nodes[multiplayer.get_unique_id()]
|
||||
|
||||
player_data["money"] -= weapon.cost
|
||||
player.get_node("WeaponSystem").add(weapon.weapon_system_scene.instantiate(),"ability_first")
|
||||
try_server_buy.rpc_id(1)
|
||||
|
||||
@rpc("any_peer","call_local","reliable")
|
||||
func try_server_buy() -> void:
|
||||
if not multiplayer.is_server():
|
||||
return
|
||||
Shop.buy(multiplayer.get_remote_sender_id(),weapon)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue