Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Simple NPC Script
- #first lets make a variable called selection
- #sm.sendNext Adds the Next button to the botom right of the npc,
- #the \r\n makes it go down a line inside the npc text
- # 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
- 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")
- #now we make an if statement to check which one was selected
- if selection == 0: #This happens when you click on #L0#
- sm.sendSayOkay("You can now read") #sendSayOkay is just a npc box with the Okay on the bottom right
- elif selection == 1: #this happens when you click on #L1#
- 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
- if response: #just simple here, it checks if the response is true or not by just putting the variable name
- sm.sendSayOkay("You can now write")
- else: # Else Statement for the response, (When the person clicks no)
- sm.sendSayOkay("You don't want to learn how to write")
- elif selection == 2:#this happens when #L2# is clicked inside the npc
- chr.setHp(0) #Kills the player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement