local j=script.Parent local g=j.Parent local B=require(g.t)local N=B.tuple(B.table,B.optional(B.any),B.optional(B.integer))local function f(j,g,B)assert(N(j,g,B))local f=#j if f<=0 then return nil end B=B or f if B<1 then B=f+B end assert(B>0 and B<=f+1,string.format("\105\110\100\101\120 \037\100 \111\117\116 \111\102 \098\111\117\110\100\115 \111\102 \108\105\115\116 \111\102 \108\101\110\103\116\104 \037\100",B,f))for B=B,1,-1 do if j[B]==g then return B end end return nil end return f
local List = script.Parent

local Llama = List.Parent
local t = require(Llama.t)

local validate = t.tuple(t.table, t.optional(t.any), t.optional(t.integer))

local function findLast(list, value, from)
	assert(validate(list, value, from))

	local len = #list

	if len <= 0 then
		return nil
	end

	from = from or len

	if from < 1 then
		from = len + from
	end

	assert(from > 0 and from <= len + 1, string.format("index %d out of bounds of list of length %d", from, len))

	for i = from, 1, -1 do
		if list[i] == value then
			return i
		end
	end

	return nil
end

return findLast