Struggling with Code

Make Forums Get help Struggling with Code

This topic contains 9 replies, has 2 voices, and was last updated by  DarkAbyss 4 months, 1 week ago. This post has been viewed 183 times

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4510

    DarkAbyss
    Participant

    I am very terrible with currency systems, so I need some help…. How do I make this work?

    BarServer gives choices for “Hello! Would you like to buy something?”

    in case “>Tea, please.”

    BarServer says “That will be 5 coins!”

    if hero number of “gold” >= 5

    BarServer says “*GIVES TEA*”

    hero says “*GRABS TEA AND GIVES 5 COINS.*”

    hero number of “gold” decreases with 5

    hero receives token “Tea”

    if hero number of “gold” < 5

    BarServer says “Sorry, but you don’t have enough coins. Come back later when you have enough coins.”

    in case “>No thanks.”

    BarServer says “If you say so…”

    0
    #4511

    Comprehensible
    Moderator

    Hey Abyss!

    Could you send a screenshot? I know it’s really difficult on the forums, but much easier on discord if you’d like to join the server.

    The reason I ask is I suspect it may be indentation. Each layer, so to say, should be indented four spaces. For example:

    NPC gives choices for “How are you?”

    (four spaces) in case “good”

    (eight spaces) NPC says “Wonderful, I’m so glad to hear that!”

    (four spaces) in case “bad”

    (eight spaces) NPC says “Oh no, what’s the matter?”

     

    That’s just a hunch, so feel free to respond to this thread or find me on discord if you need more help. Good luck! 😀

    0
    #4512

    DarkAbyss
    Participant

    Thank you for the tip Comprehensible! So… I got the code to where the currency works, but now I can’t add the second in case..

     

    Here is the script:

     

    BarServer gives choices for “Hello! Would you like to buy something?”

    (four spaces)in case”>Tea, please.”

    if hero number of “gold” >= 5

    (four spaces)BarServer says “*GIVES TEA*”

    (four spaces)hero receives token “Tea”

    (four spaces)hero says “*GRABS TEA AND GIVES 5 COINS*”

    (four spaces)hero number of “gold” decreases with 5

    (four spaces)BarServer says “Have a great day/night!”

    else

    (four spaces)BarServer says “You don’t have enough coins, sorry. Come back when you have enough!”

     

    Now, when I try to add;

    (four spaces)in case “>No thanks.”

    (four spaces)BarServer says “If you say so.”

    It says: ERROR on line 12: Action needs to follow another action. Make sure you have 4 spaces in front of sub-actions! Even when I add another four spaces to the sub-action, it still doesn’t work…

    0
    #4513

    Comprehensible
    Moderator

    No worries, that seems like a simple fix.

    (four spaces) in case “No thanks.”

    (eight spaces) Barserver says “If you say so.”

    0
    #4514

    DarkAbyss
    Participant

    Hmm.. I tried it, and it still says the ERROR. I have an idea, I give you the name to the game, and then you edit the script, and save it, and then upload it, and then you can respond saying that it should be on the recent page, it seems like a lot, but it would help me a lot!

    If you go to the recent games, it should be the game named: Dungeon, Start!

    The level the script is on, is SafezoneBar1, and the script is on the invisible floor switch, and on the far right, in front of the female server.

    0
    #4515

    Comprehensible
    Moderator

    Apologies, I’m not going to have access to a computer for awhile, so I can’t access the game. Would you mind joining the discord so you could send a screenshot, or do the whole imagr song and dance to get one on here? Sorry again.

    0
    #4516

    DarkAbyss
    Participant

    It’s alright. I’m gonna  have to do it on my phone, since the laptop I’m using, I can’t download stuff.

    0
    #4517

    Comprehensible
    Moderator

    Discord works on browser, too! No need to download anything. 🙂

    0
    #4518

    DarkAbyss
    Participant

    Kinda hard to explain, but I can’t get discord. And… I can’t send the image through my phone, because it requires a link for the source..

    0
    #4519

    DarkAbyss
    Participant

    I’ve gotta go for the night. I’ll see if you have replied in the morning. See ya!

    0
Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.