Author Topic:  Selling Blocks In A New Way!  (Read 340 times)

0 Members and 1 Guest are viewing this topic.

DaRkShAdOwYlaf

  • Jr. Member
  • **
  • Posts: 42
  • @
    • View Profile
    • Awards
  • Xbox: DaRkShAdOwYlaf
Selling Blocks In A New Way!
« on: March 21, 2017, 07:07:43 PM »
I was thinking of doing a script for my map my having a script where the players could sell blocks but I find an error & I can't find where it is...

Imput [Sell]
If
HasInventory [Player] [retro] [Sell]
Then
Inventory [Player] [take] [retro] [Sell]
Inventory [Player] [add] [goldpieces] [10000]
Else
Notify [You need more retro!]
EndIf

Hopefully you can tell me the errors! If you can that would be great as it could then use it on my map!

AlienizdPixel

  • Tester
  • Supreme Member
  • *****
  • Posts: 2576
  • Hallo
  • Awards 3 years on site+600 posts Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site+300 posts Was in the top 10 of the forum stats page as of 4/12/15 1 year on site+100 posts
    • View Profile
    • Awards
  • Xbox: A1ienizdPixe1
  • Steam: Alienizd
Re: Selling Blocks In A New Way!
« Reply #1 on: March 21, 2017, 07:39:58 PM »
Imnput [Sell] Imput should be Input
If
HasInventory [Player] [retro] [>=] [Sell] There needs to be a comparative sign between [retro] and [Sell]
Then
Inventory [Player] [take] [retro] [Sell]
Inventory [Player] [add] [goldpieces] [10000]
Else
Notify [You need more retro!]
EndIf

This script also does not take into consideration how many items are being sold, meaning that not how many the player inputs, they will always receive 10000 GoldPieces. Use this edit to have it not do as such.

Input [Sell]
Var [Recieve] = [10000] [*] [Sell]
If
HasInventory [Player] [retro] [>=] [Sell]
Then
Inventory [Player] [take] [retro] [Sell]
Inventory [Player] [add] [goldpieces] [10000][Recieve]
Else
Notify [You need more retro!]
EndIf
-Alionz

DaRkShAdOwYlaf

  • Jr. Member
  • **
  • Posts: 42
  • @
    • View Profile
    • Awards
  • Xbox: DaRkShAdOwYlaf
Re: Selling Blocks In A New Way!
« Reply #2 on: March 22, 2017, 07:01:01 PM »
Thanks!