`local plr = game.Players.LocalPlayer
local RollButton = script.Parent.Roll
local LatestRollerLabel = script.Parent.LatestRoller
local MultiChanceLabel = script.Parent.MultiChance
local Rollers = {
["Common"] = 65;
["Uncommon"] = 42;
["Rare"] = 30;
["Epic"] = 23;
["Legendary"] = 13;
["Mythic"] = 5;
["Godly"] = 0.7;
["Black Hole"] = 0.1;
}
local function ChooseRoller()
local totalProbability = 0
for roller, chance in pairs(Rollers) do
totalProbability = totalProbability + chance
end
local randomValue = Random.new():NextNumber(0,totalProbability)
for roller, chance in pairs(Rollers) do
randomValue = randomValue - chance
if randomValue <= 0 then
return roller
end
end
return nil
end
local SpawnRoller = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvents"):WaitForChild("SpawnRoller")
local db = false
local RollerColors = {
["Common"] = Color3.fromRGB(85, 255, 91);
["Uncommon"] = Color3.fromRGB(69, 208, 74);
["Rare"] = Color3.fromRGB(29, 89, 255);
["Epic"] = Color3.fromRGB(114, 0, 171);
["Legendary"] = Color3.fromRGB(239, 184, 56);
["Mythic"] = Color3.fromRGB(255, 0, 0);
["Godly"] = Color3.fromRGB(255, 255, 127);
["Black Hole"] = Color3.fromRGB(17, 17, 17);
}
local function SetLatestRollerLabelColor(LatestRoller)
for roller, color in pairs(RollerColors) do
if roller == LatestRoller then
return color
end
end
end
RollButton.MouseButton1Click:Connect(function()
if db == false then
db = true
local ChosenRoller = ChooseRoller()
SpawnRoller:FireServer(ChosenRoller)
LatestRollerLabel.Text = ChosenRoller
LatestRollerLabel.TextColor3 = SetLatestRollerLabelColor(ChosenRoller)
task.wait(1)
db = false
end
end)`
The issue is that for some reason Roblox is not rendering the objects into the folder and only 3 of the objects get rendered (the same 3 each time)
it just means that the Roller variable, which i guess is a string doesnt match any instance names in the Rollers Folder. which will return nil and nil can’t use Clone().