Jump to content

Nevada State Lottery


lilwayne1982

Recommended Posts

i made a small grocery store mod and was thinking about unique features i could add

 

What about the ability to buy lottery tickets and potentially win?

 

what im getting at is will any1 be willing to help me with the script? im very unskilled when it comes to scripts

 

thanks for helping!

Link to comment
Share on other sites

i made a small grocery store mod and was thinking about unique features i could add

 

What about the ability to buy lottery tickets and potentially win?

 

what im getting at is will any1 be willing to help me with the script? im very unskilled when it comes to scripts

 

thanks for helping!

You would have to store the prize somewhere. Well, you could just spawn the caps or whatever but that wouldn't be very atmospheric. One would expect a larger large security force to be present. Maybe they'll have new weapons and armor :D

Link to comment
Share on other sites

What I would do is make ~ 10 'tokens' or notes. So you give the player the option to buy one of these 10 notes.

I would invoke the lottery process through an NPC most likely.

The script to determine the winning ticket would be something like this:

 

short rand           ; random number between 0-100
short winningticket  ; which ticket is the winner ( 1- 10 )

set rand to GetRandomPercent

if rand < 10 
  set winningticket to 1
elseif rand < 20
  set winningticket to 2
elseif rand < 30 
  set winningticket to 3
elseif rand < 40 
  set winningticket to 4
...

 

Then you just do a

 If Player.GetItemCount Ticketnumber == winningticket 

then s/he wins.

Link to comment
Share on other sites

What I would do is make ~ 10 'tokens' or notes. So you give the player the option to buy one of these 10 notes.

I would invoke the lottery process through an NPC most likely.

The script to determine the winning ticket would be something like this:

 

short rand           ; random number between 0-100
short winningticket  ; which ticket is the winner ( 1- 10 )

set rand to GetRandomPercent

if rand < 10 
  set winningticket to 1
elseif rand < 20
  set winningticket to 2
elseif rand < 30 
  set winningticket to 3
elseif rand < 40 
  set winningticket to 4
...

 

Then you just do a

 If Player.GetItemCount Ticketnumber == winningticket 

then s/he wins.

 

 

so how exactly would i go abouts adding this? just making a new script and copy/paste what you presented or do i have to change some numbers and text? do i have to add it to tickets as well, and how when you recieve the winning ticket you cash it?

 

i really apreciate ur help too paladin

Link to comment
Share on other sites

lilwayne, they'll be more to it then that. That script will randomly pick a winning ticket. you'll have to set it up to allow the player to purchase a ticket. If you do it this way, the odds will be 1 in 10 as there will only be one ticket.

 

However you can easily say that there's only 10 tickets left, and give them random numbers like "Ticket 5549", "Ticket 1290" etc to give the illusion of a larger lottery.

Edited by PaladinRider
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...