Jump to content



Photo
- - - - -

Number to string in the script

string operation

  • Please log in to reply
2 replies to this topic

#1 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 01 November 2023 - 04:44 PM

I need a little help.

 

I have this i.e. 3 sfx laser_1, laser_2, laser_3

 

var = Int(Rnd*3)+1
 
PlaySound "laser_" + var to string
 
How can I add var as string to have the right file name?
 
Thanks
 


#2 Wizball

Wizball

    Enthusiast

  • Members
  • PipPipPip
  • 180 posts

  • Flag: ---------

  • Favorite Pinball: Tales of the Arabian Nights

Posted 01 November 2023 - 04:55 PM

Plus is for adding numbers. Use & if you want to put a string together.

PlaySound "laser_" & var

 



#3 boriskarloff

boriskarloff

    Enthusiast

  • Members
  • PipPipPip
  • 220 posts

  • Flag: Italy

  • Favorite Pinball: kenney station

Posted 01 November 2023 - 05:02 PM

Oh, so easy.

Thanks







Also tagged with one or more of these keywords: string, operation