Gwith

Game

May 9th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1.  
  2. $player = New-Object psobject -property @{ name = ""; skill = ""; class = ""}
  3.  
  4. Function Menu
  5. {
  6. $player.class = Read-Host "Select class:
  7. 1) Warrior
  8. 2) Mage
  9. Choice"
  10. While ( $player.class -ne "1" -and $player.class -ne "2" )
  11. {
  12. Write-Host "Invalid selection. Please choose 1 or 2"
  13. $player.class = Read-Host "Choice"
  14. }
  15. switch ($player.class)
  16. {
  17. "1" { Write-Host ("You have selected the Warrior")}
  18. "2" { Write-Host ("You have selected the Mage")}
  19. }
  20. }
  21.  
  22.  
  23. if ($player.class -eq 1)
  24. {
  25. write-host "Select your skill:
  26. 1) Mortal Strike
  27. 2) Rage Strike"
  28. }
  29. else
  30. {
  31. write-host "Select your skill:
  32. 1) Fireball
  33. 2) Frostbolt"
  34. }
Advertisement
Add Comment
Please, Sign In to add comment