So I am making a pet system for my simulator game.

I am trying to get text color from module script. But no matter what I do and I don't know what's the problem, it prints an error: "Request module experienced error while loading" which means there's no value returned.

My script inside module script:

local RarityColor = {
	["Common"] = {112, 112, 112},
	["Uncommon"] = {0, 195, 13},
	["Rare"] = {0, 89, 255},
	["Epic"] = {105, 35, 255},
	["Legendary"] = {195, 0, 3}
}

My script inside local script ( where the text is ):

local Pets = game:GetService("ReplicatedStorage"):WaitForChild("Pets")
local RarityPetList = require(Pets:WaitForChild("RarityPetList"))
local ColorPetList = require(Pets:WaitForChild("RarityColorList"))

local Rarity = RarityPetList[tonumber(pet)]
Frame.Rarity.Text = Rarity -- im just trying to get pet's rarity
local Color = ColorPetList[Rarity]
Frame.Rarity.TextColor3 = Color3.new(Color[1], Color[2], Color[3])

Any help would be appreciated since i'm not sure what's wrong?

NEVERMIND! I FORGOT TO PUT return RarityColor in module script bruh!

2 comments

0

LOL

0

LOL