Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a Pandora's Box? [closed]

Asked by 8 years ago

Hi, I am trying to make a pandoras box in roblox but I am stuck at the scripting part I don't know what to do So my question is that if can anyone here help out with the script?. If so that will be greatly appreciated

0
What don't you know how to do? The entire scripting part? And if this is a request, it should not be asked here. FrostTaco 90 — 8y

Closed as Too Broad by alphawolvess and User#5423

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

This would work in a similar way in choosing any card from a deck of cards randomly. You can implement this idea to do different things.

function getRandomCard() 
  local number = math.random(13)
  local suit = math.random(4)
  local card = ""
  if number >= 1 and number <= 9 then card = number + 1
  elseif number == 10 then card = "Jack"
  elseif number == 11 then card = "Queen"
  elseif number == 12 then card = "King"
  elseif number == 13 then card = "Ace"
  else card = "?" end

  card = card .. " of "

  if suit == 1 then card = card .. "Hearts"
  elseif suit == 2 then card = card .. "Diamonds"
  elseif suit == 3 then card = card .. "Clubs"
  elseif suit == 4 then card = card .. "Spades"
  else card = card .. "?" end

  return card
end

Source From Roblox Wiki

0
Hi benj Can you just explain this in more simpler terms, Thanks! Cheesepotato999 8 — 8y
Ad