Trying to make a weapon selection UI. The actual UI is pretty simple but I can’t figure out how to grant one specific player(the one who pressed the button on the UI) the weapons from the granter. I don’t even know where to start so here’s the code I have so far:
OG_Button.OnClick().Subscribe(OG_Pressed)
New_Button.OnClick().Subscribe(New_Pressed)
OG_Pressed(Message:widget_message):void =
# Insert code that grants items to player who pressed button
# Code below closes UI
if (PlayerUI:player_ui = GetPlayerUI[Message.Player], MyUI: overlay = MyMap[Message.Player]?, SelectedButton: text_button_base = text_button_base[Message.Source]):
PlayerUI.RemoveWidget(MyUI)
if (MyMap[Message.Player] = false) {}
return
New_Pressed(Message:widget_message):void =
# Insert code that grants items to player who pressed button
# Code below closes UI
if (PlayerUI:player_ui = GetPlayerUI[Message.Player], MyUI: overlay = MyMap[Message.Player]?, SelectedButton: text_button_base = text_button_base[Message.Source]):
PlayerUI.RemoveWidget(MyUI)
if (MyMap[Message.Player] = false) {}
return
Any suggestions with how I would do this?