--[[Super Util]]
--
function WaitForChild(parent,...)
	local debugPrint = false
	for _, i in ipairs({...}) do
		if type(i)=='boolean' then
			debugPrint = i
		else
			while not parent:FindFirstChild(i) do  
				wait(1/30) 
				if debugPrint then
					print(script.Name..':'..parent.Name..' Waiting for '.. i)
				end
			end
			parent=parent[i]
		end
	end
	return parent
end

function ForEach(parent,func)
	if type(parent)=='table' then
		for _,i in pairs(parent) do
			func(i)
		end
	else
		for _,i in pairs(parent:GetChildren()) do
			func(i)
		end
	end
end

function MakeValue(class,name,value,parent)
	local temp = Instance.new(class)
	temp.Name = name
	temp.Value = value
	temp.Parent = parent
	return temp
end	

function TweenProperty(obj, propName, inita, enda, length,sentinel)
	local startTime = tick()
	local mySentinel = sentinel.Value
	local diff = enda-inita
	while tick()-startTime<length and mySentinel==sentinel.Value do
		obj[propName] = (((tick()-startTime)/length)*diff)+inita
		wait(1/30)
	end
	obj[propName] = enda	
end
