Good Evenings peeps, I’m new using Verse, UEFN and coding ;p
The expected behavior is: The player collect GoldItemData and exchanging it for a custom currency. I’m using Item spawner, item remover, Button and a conditional button.
But trying the current behavior is: The coins is sold and removed from the inventory but the player can press the button for infinite point.
This is my current code:
#Selling Gold Coin for Point OnButtonPress(Agent:agent):void= if: DoYouHaveGold.HasAllItems[Agent] then: GoldCoinRemover.Remove(Agent) if: PlayerObj:=player[Agent] CustomPlayer:Custom_Player = PlayersMap[PlayerObj] then: CustomPlayer.AddGold(CollectibleValue) else: Print("You dont't have Gold Coins")
I also tried this iteration with the same behavior
OnButtonPress(Agent:agent):void= if: DoYouHaveGold.HasAllItems[Agent] PlayerObj:=player[Agent] CustomPlayer:Custom_Player = PlayersMap[PlayerObj] then: GoldCoinRemover.Remove(Agent) CustomPlayer.AddGold(CollectibleValue)
What I’m I doing wrong ?