Advertisement
jesse123sb

Rng game script

Jul 7th, 2024
3,324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.41 KB | None | 0 0
  1.  
  2. steps:1 insert a screen gui in starter gui dont rename it or it wont work
  3. 2: insert a textbutton in screen gui and place it where u want and rename it 2 Roll
  4. 3:insert a local script in in Roll Roll is in screen gui and Dont rename it or it wont work
  5. then copy and paste this script if it doesnt work look at the tutrial link: https://www.youtube.com/watch?v=E7FKdaL1S04&t=1s
  6.  
  7.  
  8.  
  9.  
  10. Whats the tutrial here and see how to do it : https://www.youtube.com/watch?v=E7FKdaL1S04&t=1s
  11.  
  12. Script:
  13.  
  14.  
  15. local rarityFonts = {
  16. Common = Enum.Font.SourceSans,
  17. Uncommon = Enum.Font.SourceSansBold,
  18. Rare = Enum.Font.Gotham,
  19. Epic = Enum.Font.ArialBold,
  20. Legendary = Enum.Font.Fantasy,
  21. Mythical = Enum.Font.Bodoni,
  22. Exotic = Enum.Font.Antique,
  23. Divine = Enum.Font.Cartoon,
  24. UltraRare = Enum.Font.FredokaOne,
  25. SuperRare = Enum.Font.Highway,
  26. MegaRare = Enum.Font.Oswald,
  27. HyperRare = Enum.Font.LuckiestGuy,
  28. InsaneRare = Enum.Font.Creepster,
  29. CrazyRare = Enum.Font.AmaticSC,
  30. Unique = Enum.Font.Nunito,
  31. Special = Enum.Font.Roboto,
  32. Elite = Enum.Font.DenkOne,
  33. Supreme = Enum.Font.Garamond,
  34. Ultimate = Enum.Font.PermanentMarker,
  35. Masterpiece = Enum.Font.Garamond,
  36. }
  37.  
  38. local rarityColors = {
  39. Common = Color3.fromRGB(255, 255, 255),
  40. Uncommon = Color3.fromRGB(0, 255, 0),
  41. Rare = Color3.fromRGB(0, 0, 255),
  42. Epic = Color3.fromRGB(255, 0, 255),
  43. Legendary = Color3.fromRGB(255, 215, 0),
  44. Mythical = Color3.fromRGB(128, 0, 128),
  45. Exotic = Color3.fromRGB(255, 165, 0),
  46. Divine = Color3.fromRGB(255, 255, 0),
  47. UltraRare = Color3.fromRGB(0, 128, 128),
  48. SuperRare = Color3.fromRGB(255, 69, 0),
  49. MegaRare = Color3.fromRGB(139, 0, 139),
  50. HyperRare = Color3.fromRGB(255, 140, 0),
  51. InsaneRare = Color3.fromRGB(75, 0, 130),
  52. CrazyRare = Color3.fromRGB(255, 20, 147),
  53. Unique = Color3.fromRGB(186, 85, 211),
  54. Special = Color3.fromRGB(148, 0, 211),
  55. Elite = Color3.fromRGB(30, 144, 255),
  56. Supreme = Color3.fromRGB(255, 99, 71),
  57. Ultimate = Color3.fromRGB(60, 179, 113),
  58. Masterpiece = Color3.fromRGB(255, 69, 0),
  59. }
  60.  
  61. local rollButton = script.Parent -- Assuming the script is a child of the Roll button
  62. local skipButton
  63. local equipButton
  64. local isRolling = false
  65. local currentRarityGui = nil
  66.  
  67. local rarityLabel = Instance.new("TextLabel")
  68. rarityLabel.BackgroundTransparency = 1
  69. rarityLabel.Size = UDim2.new(0, 200, 0, 50)
  70. rarityLabel.TextSize = 30
  71. rarityLabel.Position = UDim2.new(0.5, -100, 0.5, -25)
  72. rarityLabel.AnchorPoint = Vector2.new(0.5, 0.5)
  73. rarityLabel.Parent = game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui
  74.  
  75. local function playTransitionSound()
  76. local sound = Instance.new("Sound")
  77. sound.SoundId = "rbxassetid://9119713951" -- Replace YOUR_SOUND_ID with the ID of your sound
  78. sound.Volume = 0.5
  79. sound.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
  80. sound:Play()
  81. sound.Ended:Connect(function()
  82. sound:Destroy()
  83. end)
  84. end
  85.  
  86. local rarities = {
  87. "Common",
  88. "Uncommon",
  89. "Rare",
  90. "Epic",
  91. "Legendary",
  92. "Mythical",
  93. "Exotic",
  94. "Divine",
  95. "UltraRare",
  96. "SuperRare",
  97. "MegaRare",
  98. "HyperRare",
  99. "InsaneRare",
  100. "CrazyRare",
  101. "Unique",
  102. "Special",
  103. "Elite",
  104. "Supreme",
  105. "Ultimate",
  106. "Masterpiece",
  107. }
  108.  
  109. local function showRarity()
  110. if isRolling then return end
  111. isRolling = true
  112. rollButton.Text = "Rolling..."
  113. rollButton.Active = false
  114.  
  115. for _ = 1, 10 do -- Adjust the number of transitions as needed
  116. local randomIndex = math.random(1, #rarities)
  117. local rarity = rarities[randomIndex]
  118.  
  119. rarityLabel.Text = rarity
  120. rarityLabel.Font = rarityFonts[rarity]
  121. rarityLabel.TextStrokeTransparency = 0
  122. rarityLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
  123. rarityLabel.TextColor3 = rarityColors[rarity]
  124.  
  125. playTransitionSound() -- Play the transition sound
  126.  
  127. wait(0.3) -- Adjust the speed of transition as needed
  128. end
  129.  
  130. skipButton = Instance.new("TextButton")
  131. skipButton.Parent = rarityLabel.Parent
  132. skipButton.Size = UDim2.new(0, 80, 0, 30)
  133. skipButton.Position = UDim2.new(0.5, -40, 0.6, 0)
  134. skipButton.AnchorPoint = Vector2.new(0.5, 0)
  135. skipButton.Text = "Skip"
  136. skipButton.BackgroundTransparency = 0.75
  137. skipButton.BackgroundColor3 = Color3.new(0, 0, 0)
  138. skipButton.TextColor3 = Color3.new(1, 1, 1)
  139. skipButton.MouseButton1Click:Connect(function()
  140. rarityLabel.Text = ""
  141. if currentRarityGui then
  142. skipButton:Destroy()
  143. equipButton:Destroy()
  144. isRolling = false
  145. rollButton.Text = "Roll"
  146. rollButton.Active = true
  147. end
  148. end)
  149.  
  150. equipButton = Instance.new("TextButton")
  151. equipButton.Parent = rarityLabel.Parent
  152. equipButton.Size = UDim2.new(0, 80, 0, 30)
  153. equipButton.Position = UDim2.new(0.5, 40, 0.6, 0)
  154. equipButton.AnchorPoint = Vector2.new(0.5, 0)
  155. equipButton.Text = "Equip"
  156. equipButton.BackgroundTransparency = 0.75
  157. equipButton.BackgroundColor3 = Color3.new(0, 0, 0)
  158. equipButton.TextColor3 = Color3.new(1, 1, 1)
  159. equipButton.MouseButton1Click:Connect(function()
  160. print("Equip")
  161. isRolling = false
  162. if currentRarityGui then
  163. currentRarityGui:Destroy()
  164. end
  165. currentRarityGui = Instance.new("BillboardGui")
  166. currentRarityGui.Parent = game.Players.LocalPlayer.Character.Head
  167. currentRarityGui.Size = UDim2.new(0, 100, 0, 40)
  168. currentRarityGui.AlwaysOnTop = true
  169. currentRarityGui.StudsOffset = Vector3.new(0, 2, 0) -- Adjust the offset to move the Gui above the head
  170.  
  171. local textLabel = Instance.new("TextLabel")
  172. textLabel.Parent = currentRarityGui
  173. textLabel.Size = UDim2.new(1, 0, 1, 0)
  174. textLabel.BackgroundTransparency = 1
  175. textLabel.Text = rarityLabel.Text
  176. textLabel.Font = rarityFonts[rarityLabel.Text]
  177. textLabel.TextColor3 = rarityColors[rarityLabel.Text]
  178. textLabel.TextStrokeTransparency = 0
  179. textLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
  180. textLabel.TextSize = 20
  181.  
  182. skipButton:Destroy()
  183. equipButton:Destroy()
  184. rollButton.Text = "Roll"
  185. rollButton.Active = true
  186. end)
  187. end
  188.  
  189. rollButton.MouseButton1Click:Connect(function()
  190. showRarity()
  191. end)
  192.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement