Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1. #Simple NPC Script
  2.  
  3. #first lets make a variable called selection
  4.  
  5. #sm.sendNext Adds the Next button to the botom right of the npc,
  6. #the \r\n makes it go down a line inside the npc text
  7. # the #L0# and #L1# and #L2 are the selections, and they corrospend to what number is clicked on the option the #l after each one closes the selection, #L0#Hello#l is how it would look
  8. selection = sm.sendNext("What would you like?\r\n#L0#I want to read#l\r\n#L1#I want to Write#l\r\n#L2#I want to die#l")
  9.  
  10. #now we make an if statement to check which one was selected
  11. if selection == 0: #This happens when you click on #L0#
  12.     sm.sendSayOkay("You can now read") #sendSayOkay is just a npc box with the Okay on the bottom right
  13. elif selection == 1: #this happens when you click on #L1#
  14.     response = sm.sendAskYesNo("You want to learn how to write?") # we made the variable response, because we're askng a yes or no question and will have an if statement to check if yes or no
  15.     if response: #just simple here, it checks if the response is true or not by just putting the variable name
  16.         sm.sendSayOkay("You can now write")
  17.     else: # Else Statement for the response, (When the person clicks no)
  18.         sm.sendSayOkay("You don't want to learn how to write")
  19. elif selection == 2:#this happens when #L2# is clicked inside the npc
  20.     chr.setHp(0) #Kills the player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement