Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Lottery?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Greenwado
Well, it's just me, what did you expect?




Joined: 09 Aug 2010
Posts: 70
Location: Okacha (OK-A-CHA)

PostPosted: Wed Nov 03, 2010 9:04 am    Post subject: Lottery? Reply with quote

Ok so I found SilverWolf's Lottery script:
Code:

#Lottery script -

define script (2,lottery,none)

script, lottery, begin
variable(number)
setvariable(number,random(1,20))
if (number==1) then (get money(1)) #you get 1 money
if (number==2) then (get money(1)) #etc.
if (number==3) then (get money(1))
if (number==4) then (get money(1))
if (number==5) then (get money(1))
if (number==6) then (get money(5))
if (number==7) then (get money(5))
if (number==8) then (get money(5))
if (number==9) then (get money(10))
if (number==10) then (get money(10))
if (number==11) then (get money(10))
if (number==12) then (get money(50))
if (number==13) then (get money(50))
if (number==14) then (get money(75))
if (number==15) then (get money(75))
if (number==16) then (get money(100))
if (number==17) then (get money(100))
if (number==18) then (get money(1000))
if (number==19) then (get money(5000))
if (number==20) then (get money(10000))
end


Would this still work?
Would it be attachable to a textbox?
How can I make it work by spending a "Lottery Ticket" item?

Thanks
_________________
Happy RPG Makin
Back to top
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Nov 04, 2010 12:43 am    Post subject: Reply with quote

Yes, it still works. It could do with an improvement though: actually telling you how much you won

Code:
global variable (1, lottery win)

plotscript, lottery, begin
  variable(number)
  number := random(1,20)
  if (number==1) then (lottery win := 1) #you get 1 money
  if (number==2) then (lottery win := 1) #etc.
  if (number==3) then (lottery win := 1)
  if (number==4) then (lottery win := 1)
  if (number==5) then (lottery win := 1)
  if (number==6) then (lottery win := 5)
  if (number==7) then (lottery win := 5)
  if (number==8) then (lottery win := 5)
  if (number==9) then (lottery win := 10)
  if (number==10) then (lottery win := 10)
  if (number==11) then (lottery win := 10)
  if (number==12) then (lottery win := 50)
  if (number==13) then (lottery win := 50)
  if (number==14) then (lottery win := 75)
  if (number==15) then (lottery win := 75)
  if (number==16) then (lottery win := 100)
  if (number==17) then (lottery win := 100)
  if (number==18) then (lottery win := 1000)
  if (number==19) then (lottery win := 5000)
  if (number==20) then (lottery win := 10000)
  get money(lottery win)
  show text box(10)   # textbox containing "You won $${G1}!"
end


Now you can write ${G1} in a textbox, and it'll be replaced with the amount you won.

On way you could use it:
*Attach an in-inventory tag to your lottery ticket (let's say tag 5)
*Create a textbox explaining that you have no lottery ticket (let's say it's box 10)
*Create a textbox which instead-chains to box 10 if tag 5 is off, and otherwise removes one lottery ticket and chains to the "lottery" script afterwards. Write some kind of message here to create anticipation. Then link this textbox to something.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group