i got this error and i cant find a way to fix it someone please help
script:
local char = script.Parent
local plr = game.Players:GetPlayerFromCharacter(char)
local Equipped = plr.leaderstats:WaitForChild("Equipped")
local Chances = require(game.ReplicatedStorage.Chances)
local cg = game.ReplicatedStorage.ChanceGUI
local cgc = cg:Clone()
Equipped.Value.Changed:Connect(function()
local RarityName = table.find(Chances, Equipped.Value)
local raritychance = RarityName[2]
cgc.Parent = char.Head
cgc.name.Text = "1 in "..raritychance
end)
Is that a ModuleScript you’re trying to require? If it is, can I see inside of it? If it’s just a table, you might be able to move it to that script.
Please keep a backup of your old code - this is untested. (Assuming RarityName is a string) RarityName is coming back as nil because you are searching for a number. You can move the module content to this script as well. Try this: