Advertisement
wulfbawg

Fun Graves - RBXLUA

May 18th, 2015
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.23 KB | None | 0 0
  1. -- > By wulfbug9.
  2. -- > Nothing much to say about this.
  3.  
  4. -- > ... lol
  5.  
  6. Beginning = " R.I.P \n %s \n %s - %s \n\n "
  7. Sayings = { "Was cool, and stuff.", "Probably gunna come back from the dead. \n Just saying. ",
  8.     "Too happy for their own good.", "Was most likely a closet-homose\5xual. Sorry.",
  9.     "In a happier place...?", "Everyone loved them, but they were still an as\5shole.",
  10.     "This guy is like, totally dead, yo!", "May or may not comes back as a zombie.",
  11.     "Not sure if dead, or buried alive...", "'Watch out guys, I'm gunna pull a Jesus on you!'",
  12.     "There's no bones here. Go away, creep.", "I'm with stupid. -->", "<-- I'm with stupid.",
  13.     "<3", "</3", "Will see you in he\5ll.", "Killed by love. Literally.", "Should have never eaten that cake.",
  14.     "I'm with stupid.\n V", "Died laughing. Never heard the end of the joke.", "Got hit by a train.",
  15.     "Brutally r\5aped by Nick Cage.", "Got stabbed by wooden stick. Was, unfortunately, a vampire.",
  16.     "You still owe me 5 bucks, %s!", "'%s was a jerk. Kick them for me.' - Famous Last Words",
  17.     "Found in a trash can. Presumably gang-banged to death.", "'%s-senpai didn't notice me.'",
  18.     "Consecutively stabbed by all their ex-lovers.\nFound with exactly 74 stab wounds.\nEat karma, jerk.",
  19.     "Stabbed by their pet unicorn.\n'Horny didn't mean it!'", "Eaten alive by their pet squirrel, Mr. Squiggles.",
  20.     "He was #1!!", "OJ was the real killer!", "'I wonder what this tastes like...' - Last Words",
  21.     "I was all like, woooooah! I'm dead! Awww maaan...",
  22. }
  23.  
  24. function getYear()
  25.     local Tick = tick()
  26.     local YearStarted = 1970
  27.     local Years = Tick / 60
  28.     Years = Years / 60
  29.     Years = Years / 24
  30.     Years = Years / 30.5
  31.     Years = Years / 12
  32.     Years = math.floor(Years)
  33.     return YearStarted + Years
  34. end
  35. function getPlayerYears(Player)
  36.     local Age = Player.AccountAge
  37.     local Year = Age / 365
  38.     return getYear() - math.ceil(Year)
  39. end
  40.  
  41. function getRandomPlayer(Player)
  42.     local Players = game:service("Players"):players()
  43.     if #Players == 1 then
  44.         return Player
  45.     end
  46.     local RandPlayer
  47.     repeat wait()
  48.         RandPlayer = Players[math.random(1, #Players)]
  49.     until RandPlayer ~= Player
  50.     return RandPlayer
  51. end
  52. function formatGraveSaying(Player, Saying)
  53.     return Beginning:format(Player.Name, getPlayerYears(Player), getYear()) .. Saying:format(getRandomPlayer(Player).Name)
  54. end
  55.  
  56. function Random(A)
  57.     return (math.random()-.5)*2*(A or 1)
  58. end
  59.  
  60. function makeGrave(Player, Saying, CF)
  61.     local Saying = Saying or Sayings[math.random(1, #Sayings)]
  62.     local RandX, RandY = math.random(4, 5), math.random(5, 7)
  63.     local CF = CF or Player.Character:GetModelCFrame()
  64.     CF = CFrame.new(CF.X, (RandY/2), CF.Z + 2) * CFrame.Angles(0, 0, 0)
  65.     local Grave = Instance.new("Part", workspace)
  66.     Grave.Material = "Concrete"
  67.     Grave.BrickColor = BrickColor.new("Grey")
  68.     Grave.Anchored = true
  69.     Grave.TopSurface, Grave.BottomSurface = 0, 0
  70.     Grave.FormFactor = "Custom"
  71.     Grave.Size = Vector3.new(RandX, RandY, .5)
  72.     Grave.CFrame = CF * CFrame.Angles(Random(.075), Random(0), Random(.075))
  73.     local Top = Instance.new("Part", workspace)
  74.     Top.Material = "Concrete"
  75.     Top.BrickColor = BrickColor.new("Grey")
  76.     Top.Anchored = true
  77.     Top.TopSurface, Top.BottomSurface = 0, 0
  78.     Top.FormFactor = "Custom"
  79.     Top.Size = Vector3.new(RandX, .5, RandX)
  80.     Top.CFrame = Grave.CFrame * CFrame.new(0, RandY / 2, 0) * CFrame.Angles(math.pi/2, 0, 0)
  81.     Instance.new("CylinderMesh", Top).Scale = Vector3.new(1, .99, 1)
  82.     local Surface = Instance.new("SurfaceGui", Grave)
  83.     Surface.Face = "Front"
  84.     Surface.CanvasSize = Vector2.new(RandX * 100, RandY * 100)
  85.     local Text = Instance.new("TextLabel", Surface)
  86.     Text.BackgroundTransparency = 1
  87.     Text.Text = formatGraveSaying(Player, Saying)
  88.     Text.FontSize = 8
  89.     Text.TextYAlignment = "Top"
  90.     Text.TextWrap = true
  91.     Text.TextStrokeTransparency = 1
  92.     Text.TextColor3 = Color3.new(1, 1, 1)
  93.     Text.Size = UDim2.new(1, 0, 1, 0)
  94. end
  95.  
  96. --[[
  97. for i, v in pairs(game:service("Players"):players()) do
  98.     makeGrave(v)
  99. end--]]
  100.  
  101. X, Z = -60, 0
  102. BCF = CFrame.new(0, 3, -50)
  103. for i = 1, #Sayings do
  104.     local Saying = Sayings[i]
  105.     local Player = game:service("Players"):players()[math.random(1, #game:service("Players"):players())]
  106.     makeGrave(Player, Saying, BCF * CFrame.new(X, 0, Z))
  107.     X = X + 10
  108.     if i % 6 == 0 then
  109.         Z = Z - 15
  110.         X = -60
  111.         wait()
  112.     end
  113. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement