Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 2 music tracks, playing at once, only want 1

Author
Message
Shadow Legacy
13
Years of Service
User Offline
Joined: 20th Nov 2010
Location: Infront of my computer
Posted: 26th Nov 2010 20:23
the problem is that I want this code to generate a random number up to 2, and then 1 would equal track 1 and 2 would equal track 2, and that track would loop constantly, I don't need it to change mid game at least for now.


this is what I've tried

DBPro noob here
Skype = Shadow-Legacy
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 26th Nov 2010 21:19
Well, you've got a couple of different problems there.

rnd(2) returns a random number from 0 to 2, so if it comes up zero, no music is going to play. Try rnd(1)+1, which will give either a 1 or a 2.

If you want to use a multi-line if/then, you have to leave off the "then" and put an endif at the end, like



or you could just combine the two tests into an if/then/else type structure.

Shadow Legacy
13
Years of Service
User Offline
Joined: 20th Nov 2010
Location: Infront of my computer
Posted: 29th Nov 2010 15:18
cool thanks for that

DBPro noob here
Skype = Shadow-Legacy
http://shadow-legacy-script.webs.com/

Login to post a reply

Server time is: 2024-09-29 00:27:01
Your offset time is: 2024-09-29 00:27:01