#why wont this work
1 messages · Page 1 of 1 (latest)
elseif Ore:FindFirstChild("OneIn") then
if RareRandom:NextInteger(1, Ore.OneIn.Value) == 1 then
if RealOre:FindFirstChild("OreGradient") then
game.ReplicatedStorage.Announce:FireAllClients("A rare ore has spawned.",10,Ore.OreGradient.UIGradient,ColorSequence) else
game.ReplicatedStorage.Announce:FireAllClients("A rare ore has spawned.",10,Ore.OreColor.Value,Color3.new(0, 0, 0),1846398270)
return Ore
end
this is the code that is breaking everything
You're checking RealOre:FindFirstChild("OreGradient"), but then referencing Ore.OreGradient.UIGradient, which may not exist or may not be structured that way.
** You are now Level 1! **
I can try to fix the script if youd like
don't i have to do ore.oregradient.uigradient to find the right thing
local function Gamble(x,y,z,Cave)
local Lottery = {}
local oreids = {}
local RunningTotal = 0
for Index,Ore in pairs(Items) do
local MaxDepth, MinDepth = Ore.MaxDepth.Value, Ore.MinDepth.Value
if y >= MinDepth and y <= MaxDepth then
local Range = MaxDepth - MinDepth + 1
local MinDistance = y - MinDepth + 1
local MaxDistance = MaxDepth - y + 1
if Ore:FindFirstChild("UniquePosition") and Ore.UniquePosition.Value == Vector3.new(x,y,z) then
return Ore
elseif Ore:FindFirstChild("OneIn") then
if RareRandom:NextInteger(1, Ore.OneIn.Value) == 1 then
if RealOre:FindFirstChild("OreGradient") then
game.ReplicatedStorage.Announce:FireAllClients("A rare ore has spawned.",10,Ore.OreGradient.UIGradient,ColorSequence) else
game.ReplicatedStorage.Announce:FireAllClients("A rare ore has spawned.",10,Ore.OreColor.Value,Color3.new(0, 0, 0),1846398270)
return Ore
end
else
local MaxRarity, MinRarity = Ore.MaxRarity.Value, Ore.MinRarity.Value
local Chance = math.ceil(((MinDistance/Range) * MinRarity + (MaxDistance/Range) * MaxRarity) / 2)
if Chance > 0 and (Cave or not Ore:FindFirstChild("Cave")) then
RunningTotal = RunningTotal + Chance
table.insert(Lottery,RunningTotal)
table.insert(oreids,Index)
end
end
end
end
local pickone = math.random(1,RunningTotal)
for Count,ID in pairs(Lottery) do
if pickone <= ID then
return Items[oreids[Count]]
end
end
return game.ReplicatedStorage.Ores.Stone
end
this is the full script
Oh ok
well the full function
Fixed
try it
I made Realore default to Ore because it wasnt defined elsewhere
and made return Ore happen after the Announce logic regardless of branch.
realore is referenced elsewhere in the script
problem is the script is 1.1k lines soo
i cant send the script in 1 msg, i can send in 4 or 5 if you need me to
** You are now Level 1! **
Just do it as downloaded
everything else works tho, its literally just that part
Upload as file also I fixed that script you sent me again
Let me know if it fixes it

the Announcer works too, it just doesn't use the gradient which i am confused about (im new to scripting)
1s
Yeah
bacon