You can write your topic however you want, but you need to answer these questions:
Hello! I am currently creating a RNG game. With that being said I made a Rolling System, which I have a very basic version already coded! I am a upcoming programmer so I need help on something I cannot figure out/cannot find anywhere. I’ve seen numerous posts/videos about this topic and none of them go over my situation.
My situation is about a rarity system. I have a rolling system (code below) and I made and table with all the possible characters the player can receive. I already added a value named rarity. Not sure where I was going now that I think about. So if you have any feedback/suggestions please help!
–CODE:–
local RollButton = script.Parent.Roll
local RollValue = script.Parent.RollValue
local RollRarity = script.Parent.RollRarity
local Character = {
{Name = “Piggy”, Rarity = 10},
{Name =“Little Brother”, Rarity = 10},
{Name =“Mother”, Rarity = 10},
{Name =“Father”, Rarity = 10},
{Name =“Grandmother”, Rarity = 10},
{Name =“Sheepy”, Rarity = 10},
{Name =“Pandy”, Rarity = 10},
{Name =“Teacher”, Rarity = 10},
{Name =“Memory”, Rarity = 10},
{Name =“Kitty”, Rarity = 10},
{Name =“Mimi”, Rarity = 10},
{Name =“Dinopiggy”, Rarity = 10},
{Name =“Daisy”, Rarity = 10},
{Name =“Angel”, Rarity = 10},
{Name =“Pony”, Rarity = 10},
–
{Name =“Memory”, Rarity = 10},
{Name =“Mr.P”, Rarity = 100},
}
RollButton.MouseButton1Click:Connect(function()
local Roll = Character[math.random(#Character)]
RollValue.Text = Roll.Name
if Roll.Rarity == 10 then
RollRarity.Text = “Common”
RollRarity.TextColor3 = Color3.new(0, 1, 1)
elseif Roll.Rarity == 100 then
RollRarity.Text = “Epic”
RollRarity.TextColor3 = Color3.new(0.5, 0, 1)
end
end)