Hi! I’m the build guy, and I’m trying to make a randomizer with chances. I’m getting the error “Function is not a supported attribute type” on line 18. Should it not be what the function returned? Here are my scripts
AdminChances - ModuleScript
return {
["Jayknightss"] = 50,
["NOOB"] = 50,
}
SetStand - Script
local lootTable = require(game.ServerStorage:WaitForChild("AdminChances"))
local Result = function()
local Sum = 0
for StandName,Chance in pairs(lootTable) do
Sum += Chance
end
local RandomNumber = math.random(Sum)
for StandName,Chance in pairs(lootTable) do
if RandomNumber <= Chance then
return(StandName)
else
RandomNumber -= Chance
end
end
end
script.Parent:SetAttribute("Stand",Result)
Extra info: SetStand’s parent is a tool, the attribute is here.